The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior.
fix converttopsbt permitsigdata arg, add basic test #14356
pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:converttopsbt_strip changing 2 files +4 −1-
instagibbs commented at 2:10 AM on September 30, 2018: member
-
fix converttopsbt permitsigdata arg, add basic test 88a79cb436
- fanquake added the label RPC/REST/ZMQ on Sep 30, 2018
-
in test/functional/rpc_psbt.py:112 in 88a79cb436
106 | @@ -107,6 +107,9 @@ def run_test(self): 107 | # Make sure that a psbt with signatures cannot be converted 108 | signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex']) 109 | assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex']) 110 | + assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'], False) 111 | + # Unless we allow it to convert and strip signatures 112 | + self.nodes[0].converttopsbt(signedtx['hex'], True)
MarcoFalke commented at 1:03 AM on October 1, 2018:Nit: could use named args
permitsigdata=True/False?MarcoFalke commented at 1:03 AM on October 1, 2018: memberIs this for backport?
instagibbs commented at 1:51 AM on October 1, 2018: memberBackport would be appreciated.
On Sun, Sep 30, 2018, 9:06 PM MarcoFalke notifications@github.com wrote:
@MarcoFalke commented on this pull request.
Is this for backport?
In test/functional/rpc_psbt.py https://github.com/bitcoin/bitcoin/pull/14356#discussion_r221480702:
@@ -107,6 +107,9 @@ def run_test(self): # Make sure that a psbt with signatures cannot be converted signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex']) assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'])
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'], False)# Unless we allow it to convert and strip signaturesself.nodes[0].converttopsbt(signedtx['hex'], True)
Nit: could use named args permitsigdata=True/False?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/14356#pullrequestreview-160136423, or mute the thread https://github.com/notifications/unsubscribe-auth/AFgC00wnXt81XHgEIjyE4tn73YFdXSBgks5ugWqRgaJpZM4XAxPO .
MarcoFalke added this to the milestone 0.17.1 on Oct 1, 2018MarcoFalke added the label Needs backport on Oct 1, 2018achow101 commented at 3:49 PM on October 1, 2018: memberutACK 88a79cb436b30b39d37d139da723f5a31e9d161b
promag commented at 6:20 PM on October 1, 2018: memberutACK 88a79cb.
in src/rpc/rawtransaction.cpp:1672 in 88a79cb436
1668 | @@ -1669,7 +1669,7 @@ UniValue converttopsbt(const JSONRPCRequest& request) 1669 | 1670 | // Remove all scriptSigs and scriptWitnesses from inputs 1671 | for (CTxIn& input : tx.vin) { 1672 | - if ((!input.scriptSig.empty() || !input.scriptWitness.IsNull()) && (request.params[1].isNull() || (!request.params[1].isNull() && request.params[1].get_bool()))) { 1673 | + if ((!input.scriptSig.empty() || !input.scriptWitness.IsNull()) && !permitsigdata) {
jimmysong commented at 10:15 PM on October 1, 2018:Would it make sense to have the
!request.params[1].isNull()in line 1661 above?
promag commented at 12:07 PM on October 10, 2018:Why?
permitsigdatais enough?meshcollider commented at 4:01 AM on November 9, 2018: contributorsipa commented at 6:10 PM on November 12, 2018: memberutACK 88a79cb436b30b39d37d139da723f5a31e9d161b
laanwj merged this on Nov 12, 2018laanwj closed this on Nov 12, 2018laanwj referenced this in commit 47ed24cf8a on Nov 12, 2018MarcoFalke referenced this in commit 7a590d8390 on Dec 5, 2018MarcoFalke removed the label Needs backport on Dec 5, 2018deadalnix referenced this in commit 5517f469f9 on May 11, 2020UdjinM6 referenced this in commit 59b51a86e7 on Jul 15, 2021UdjinM6 referenced this in commit 7d66e6647b on Jul 15, 2021UdjinM6 referenced this in commit 47317e8fd0 on Jul 16, 2021MarcoFalke locked this on Sep 8, 2021LabelsMilestone
0.17.1
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
More mirrored repositories can be found on mirror.b10c.me