-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
walletrpc: add new PSBT creation+signing RPCs #4389
Conversation
1881600
to
b20bc35
Compare
lnrpc/walletrpc/psbt.go
Outdated
"locket UTXO", idx) | ||
} | ||
|
||
// Everything's OK, we found the UTXO and can add its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already done within the btcwallet
methods? If not, then why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, most of this is already done by the wallet. The only thing to check here is that the inputs aren't spent or locked yet.
0040f5c
to
41f780a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! Will begin playing around with it locally and report any issues.
|
||
expiration, err := w.LeaseOutput(lock.lockID, lock.outpoint) | ||
if err != nil { | ||
return nil, fmt.Errorf("could not lease a lock on "+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What @Roasbeef was referring to was to defer at the level of the caller of lockInputs
, as an error can occur in some other method after the fact and the inputs wouldn't be released. There isn't a method that's called after lockInputs
that returns an error at the moment, but it's probably still worth making the change to prevent any potential bugs in the future.
0412ffd
to
1e460b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guggero nice work! lot of good stuff in here :)
|
||
expiration, err := w.LeaseOutput(lock.lockID, lock.outpoint) | ||
if err != nil { | ||
return nil, fmt.Errorf("could not lease a lock on "+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another option would be to make a LeaseOutputs
and ReleaseOutputs
that lock all of them atomically
1e460b7
to
b2a7f33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing I think this is missing is some light doc updates, but that's totally non-blocking, and this PR has been in stasis for quite a while.
LGTM 🎨
DON'T MERGE, just discovered a bug in the fee estimation if more than one input is selected (good thing I started writing the docs for this and coming up with useful examples 😅 ) EDIT: Fix is up: btcsuite/btcwallet#721. |
Added some documentation with examples and fixed the change amount bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@guggero needs a rebase, but it should be good to merge once addressed. |
The internal lock ID that the wallet kit subserver uses to lock inputs for itself shouldn't be allowed to be used when locking inputs manually over the RPC.
We rewrite the test to use the require library to make it a bit more condensed.
Now that we have all functions that we need to complete the whole PSBT channel funding flow, we change the itest to use Dave's wallet to fund the channel from Carol to Dave through a PSBT.
Fixes #3938.
Fixes #4400.
Depends on btcsuite/btcutil#178 and btcsuite/btcwallet#711.EDIT: Depends on btcsuite/btcwallet#721.