[psbt] Convert non-witness UTXOs to witness if witness sig created#14197
Merged
laanwj merged 2 commits intobitcoin:masterfrom Nov 1, 2018
Merged
[psbt] Convert non-witness UTXOs to witness if witness sig created#14197laanwj merged 2 commits intobitcoin:masterfrom
laanwj merged 2 commits intobitcoin:masterfrom
Conversation
7e52500 to
f03eb81
Compare
fanquake
reviewed
Sep 11, 2018
src/script/sign.cpp
Outdated
Member
There was a problem hiding this comment.
Travis is complaining about whitespace here.
f03eb81 to
52d9adc
Compare
Contributor
|
ACK |
Member
|
utACK 52d9adc. I'll test this soon. |
promag
reviewed
Sep 17, 2018
src/script/sign.cpp
Outdated
| if (sigdata.witness) { | ||
| // Convert the non-witness utxo to witness | ||
| if (input.witness_utxo.IsNull() && input.non_witness_utxo) { | ||
| input.witness_utxo = input.non_witness_utxo->vout[tx.vin[index].prevout.n]; |
Contributor
There was a problem hiding this comment.
IIUC this could be
assert(!utxo.IsNull());
input.witness_utxo = utxo;
Member
|
Here is a test that fails before and succeeds after this PR: sipa@ce238f2 |
Member
|
@achow101 Feel free to cherry-pick the test into this PR. That RPC test is a reproduction of what I did to notice the issue in the first place, so Tested ACK from me. |
52d9adc to
51a6a69
Compare
Member
Author
|
I've added @sipa's test |
51a6a69 to
adc6a52
Compare
If a witness signature was created when a non-witness UTXO is used, convert the non-witness UTXO to a witness one.
adc6a52 to
862d159
Compare
Contributor
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Member
|
ACK 862d159 |
promag
reviewed
Sep 26, 2018
|
|
||
| from test_framework.test_framework import BitcoinTestFramework | ||
| from test_framework.util import assert_equal, assert_raises_rpc_error, find_output | ||
| from test_framework.util import assert_equal, assert_raises_rpc_error, find_output, disconnect_nodes, connect_nodes_bi, sync_blocks |
Contributor
|
Member
|
utACK 862d159 |
laanwj
added a commit
that referenced
this pull request
Nov 1, 2018
…sig created 862d159 Add test for conversion from non-witness to witness UTXO (Pieter Wuille) f8c1714 Convert non-witness UTXOs to witness if witness sig created (Andrew Chow) Pull request description: If a witness signature was created when a non-witness UTXO is used, convert the non-witness UTXO to a witness one. Port of #14196 to master. Tree-SHA512: 2235eeb008ffa48e821628032d689e4a83bff6c29b93fa050ab2ee492b0e67b3a30f29a680d4a0e574e05c3a2f9edf0005e161fbe25b7aef2acd034a2424e2f2
Member
sipa
added a commit
to sipa/bitcoin
that referenced
this pull request
Dec 3, 2018
Github-Pull: bitcoin#14197 Rebased-From: 862d159
maflcko
pushed a commit
that referenced
this pull request
Dec 5, 2018
7bee414 Add test for conversion from non-witness to witness UTXO (Pieter Wuille) ff56bb9 Add regression test for PSBT signing bug #14473 (Glenn Willen) db445d4 Refactor PSBTInput signing to enforce invariant (Glenn Willen) ad94165 Simplify arguments to SignPSBTInput (Glenn Willen) 39ece4f Add bool PSBTInputSigned (Glenn Willen) 70ee1f8 New PartiallySignedTransaction constructor from CTransction (Glenn Willen) a9eab08 Remove redundant txConst parameter to FillPSBT (Glenn Willen) cfdd6b2 More concise conversion of CDataStream to string (Glenn Willen) a3fe125 check that a separator is found for psbt inputs, outputs, and global map (Andrew Chow) Pull request description: This is a backport of #14588, #14377, and #14197's test to 0.17. Tree-SHA512: 07535ec69a878a63b549e5e463345e233f34662dff805202614cf2ffc896c6d1981363e6d06d02db2e02d815075ad8ebdc5f93f637052cff8c8cbe6c8dfa096a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a witness signature was created when a non-witness UTXO is used, convert the non-witness UTXO to a witness one.
Port of #14196 to master.