Commit graph

4 commits

Author SHA1 Message Date
Oliver Gugger
3252f9fc11
psbt: don't add scriptSig to txIn
Because of an incorrect test, it wasn't discovered that the scriptSig
field was being set on the unsigned TX inputs for a nested SegWit input.
This commit fixes the bug and also refactors the test so it would have
caught this specific bug.
2020-10-05 11:33:51 +02:00
Oliver Gugger
98e779a102
wallet: use constant input source for change calculation
To fix a bug where specifying multiple UTXOs that are by themselves
large enough to satisfy the output amount would lead to the rest of them
being added to fees, we need to provide the transaction author with a
constant list of UTXOs. If we didn't, the author would only consider one
input and calculate the change based on that alone. But since we'd add
all inputs to the PSBT, the rest of the amounts would go to fees.
2020-10-01 15:19:13 +02:00
Oliver Gugger
34bfc5efb9
wallet: return change index from FundPsbt
To make it easy to show the user what change output was created (if any)
during the funding process, we return its index (or -1 if no change
output was created).
2020-10-01 14:57:05 +02:00
Oliver Gugger
c4c2a9052e
wallet: add PSBT funding+finalizing methods 2020-08-27 21:15:00 +02:00