Skip to content

Conversation

@achow101
Copy link
Member

@achow101 achow101 commented Sep 11, 2018

When we sign an input in a psbt that has a non-witness utxo but a witness signature is produced, we will now replace the non-witness utxo with the corresponding witness utxo. Furthermore, we should make sure that the correct UTXO type is used based on what UTXOs are there, not based on earlier wallet behavior.

Note that this is PR'd to the 0.17 branch because the code here no longer exists in master.

@fanquake fanquake added this to the 0.17.0 milestone Sep 11, 2018
…wallet things

Instead of dropping the unnecessary UTXO based on whether the wallet did something,
do it based on whether two UTXOs are there.
If a witness signature was created when a non-witness UTXO is used,
convert the non-witness UTXO to a witness one.
@fanquake
Copy link
Member

Test failure seemed unrelated, rebooted Travis.

@gmaxwell
Copy link
Contributor

This sounds right to me.

@gmaxwell
Copy link
Contributor

ACK

@araspitzu
Copy link

Would it be possible to add a test for this?

@maflcko maflcko modified the milestones: 0.17.0, 0.17.1 Sep 30, 2018
@maflcko
Copy link
Member

maflcko commented Sep 30, 2018

Moved to 0.17.1 for now, because this can be worked around and psbt isn't considered final in the 0.17.0 release.

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
@meshcollider
Copy link
Contributor

utACK fcefc68

@sipa
Copy link
Member

sipa commented Nov 11, 2018

utACK fcefc68

@maflcko maflcko merged commit fcefc68 into bitcoin:0.17 Dec 1, 2018
maflcko pushed a commit that referenced this pull request Dec 1, 2018
…rt non-witness utxo to witness when necessary

fcefc68 Convert non-witness UTXOs to witness if witness sig created (Andrew Chow)
fcdea8a Drop the unnecessary UTXO based on the UTXOs present, not on earlier wallet things (Andrew Chow)

Pull request description:

  When we sign an input in a psbt that has a non-witness utxo but a witness signature is produced, we will now replace the non-witness utxo with the corresponding witness utxo. Furthermore, we should make sure that the correct UTXO type is used based on what UTXOs are there, not based on earlier wallet behavior.

  Note that this is PR'd to the 0.17 branch because the code here no longer exists in master.

Tree-SHA512: 882e9e4e9b77d6ac1743c35c0d59023aad6f4f19193398f97f2c6b81f6627d74e5220b1d674a0edba1ff2fc2a7f61afbf838d3faf0a964fccd3dee97c631aa47
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants