-
Notifications
You must be signed in to change notification settings - Fork 36.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix converttopsbt permitsigdata arg, add basic test #14356
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for backport?
@@ -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 signatures | |||
self.nodes[0].converttopsbt(signedtx['hex'], True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could use named args permitsigdata=True/False
?
Backport would be appreciated.
…On Sun, Sep 30, 2018, 9:06 PM MarcoFalke ***@***.***> wrote:
***@***.**** commented on this pull request.
Is this for backport?
------------------------------
In test/functional/rpc_psbt.py
<#14356 (comment)>:
> @@ -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 signatures
+ self.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
<#14356 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFgC00wnXt81XHgEIjyE4tn73YFdXSBgks5ugWqRgaJpZM4XAxPO>
.
|
utACK 88a79cb |
utACK 88a79cb. |
@@ -1669,7 +1669,7 @@ UniValue converttopsbt(const JSONRPCRequest& request) | |||
|
|||
// Remove all scriptSigs and scriptWitnesses from inputs | |||
for (CTxIn& input : tx.vin) { | |||
if ((!input.scriptSig.empty() || !input.scriptWitness.IsNull()) && (request.params[1].isNull() || (!request.params[1].isNull() && request.params[1].get_bool()))) { | |||
if ((!input.scriptSig.empty() || !input.scriptWitness.IsNull()) && !permitsigdata) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have the !request.params[1].isNull()
in line 1661 above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? permitsigdata
is enough?
utACK 88a79cb |
utACK 88a79cb |
88a79cb fix converttopsbt permitsigdata arg, add basic test (Gregory Sanders) Pull request description: The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior. Resolves #14355 Tree-SHA512: 5157a74b8ddebd7d836fba96765c4d7ed15a73d4289817353d3566a0f6803bd4bbc3f936735c517c7a83a6cbdb4052b9c61d23f6cc4ad00a6077278cd51adbd4
Github-Pull: bitcoin#14356 Rebased-From: 88a79cb
Summary: The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior. --- This is a backport of Core [[bitcoin/bitcoin#14356 | PR14356]] Test Plan: ninja check ./test_runner.py rpc_psbt Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6026
88a79cb fix converttopsbt permitsigdata arg, add basic test (Gregory Sanders) Pull request description: The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior. Resolves bitcoin#14355 Tree-SHA512: 5157a74b8ddebd7d836fba96765c4d7ed15a73d4289817353d3566a0f6803bd4bbc3f936735c517c7a83a6cbdb4052b9c61d23f6cc4ad00a6077278cd51adbd4
88a79cb fix converttopsbt permitsigdata arg, add basic test (Gregory Sanders) Pull request description: The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior. Resolves bitcoin#14355 Tree-SHA512: 5157a74b8ddebd7d836fba96765c4d7ed15a73d4289817353d3566a0f6803bd4bbc3f936735c517c7a83a6cbdb4052b9c61d23f6cc4ad00a6077278cd51adbd4
Merge bitcoin#14356: fix converttopsbt permitsigdata arg, add basic test
The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior.
Resolves #14355