walletrpc: add new PSBT creation+signing RPCs#4389
Conversation
1881600 to
b20bc35
Compare
There was a problem hiding this comment.
Isn't this already done within the btcwallet methods? If not, then why not?
There was a problem hiding this comment.
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
3203126 to
44922a8
Compare
4c65d33 to
d2e695e
Compare
wpaulino
left a comment
There was a problem hiding this comment.
Looks pretty good! Will begin playing around with it locally and report any issues.
There was a problem hiding this comment.
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
cfromknecht
left a comment
There was a problem hiding this comment.
@guggero nice work! lot of good stuff in here :)
There was a problem hiding this comment.
another option would be to make a LeaseOutputs and ReleaseOutputs that lock all of them atomically
1e460b7 to
b2a7f33
Compare
Roasbeef
left a comment
There was a problem hiding this comment.
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. |
|
@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.