print P2WSH redeemScript in getrawtransaction if it s not a pubkey - #6
Closed
czzarr wants to merge 1 commit into
Closed
print P2WSH redeemScript in getrawtransaction if it s not a pubkey#6czzarr wants to merge 1 commit into
czzarr wants to merge 1 commit into
Conversation
Author
|
I'll make it compatible with @jnewbery when his PRs are merged. |
jnewbery
reviewed
Sep 26, 2016
| } | ||
| in.push_back(Pair("txinwitness", txinwitness)); | ||
| // try to parse the last item as a pubkey | ||
| // if someone constructed the script to look like a pubkey, then he's insane |
There was a problem hiding this comment.
nit: suggest you add a bit more context to this comment. eg:
In version 0, there are two valid witness types: P2WPKH and P2WSH. P2WPKH witnesses have two items on the witness stack, the second of which is a public key. We test whether the last item on the witness stack is a valid public key, and if it isn't we try to parse it as a redeem script.
|
Note that to make this compatible with #4 , you'll need to change |
czzarr
force-pushed
the
print-p2wsh-redeemscript-in-getrawtransaction
branch
from
September 30, 2016 14:45
101eb45 to
5f18004
Compare
Author
|
I have updated the comment as suggested and posted a PR to bitcoin/bitcoin bitcoin#8849 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds code to print a readable
asmversion of theredeemScriptof aP2WSHinput in thegetrawtransactionRPC call which is useful to explore that kind of transactions.