-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Don't return the address of a P2SH of a P2SH #8845
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
Conversation
src/rpc/rawtransaction.cpp
Outdated
| UniValue type; | ||
| type = find_value(r, "type"); | ||
|
|
||
| if ((!type.isNull()) && (type.isStr()) && (type.get_str() != "scripthash")) |
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.
Should probably drop the isNull check because a value can't be both a string and a null at the same time.
Also maybe drop the parens around && conditions (searching for "&&" in this file shows no parens used in the other cases).
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.
Thanks. Both done.
925a8be to
cef66cb
Compare
|
@ryanofsky's suggestions added and rebased. |
|
utACK |
|
"Incorporated suggested changes from @ryanofsky." doesn't belong in the commit description (it will ping him every time the commit goes somewhere..) |
|
Agree. Also please don't put irrelevant information in the commit subject line. |
cef66cb to
e92d4f9
Compare
e92d4f9 to
d51f182
Compare
|
Fixed commit description. |
|
utACK |
| UniValue type; | ||
| type = find_value(r, "type"); | ||
|
|
||
| if (type.isStr() && type.get_str() != "scripthash") { |
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.
I think looking at the generated JSON here instead of the script object itself is a bit confusing, but I tend to agree it's the best way to go here to not have to repeat ExtractDestinations.
d51f182 Don't return the address of a P2SH of a P2SH. (jnewbery)
Github-Pull: bitcoin#8845 Rebased-From: cef66cbca48fa969c9fb3374f2892202a4fe31ac
Github-Pull: bitcoin#8845 Rebased-From: d51f182
Github-Pull: bitcoin#8845 Rebased-From: d51f182
be066fa added an RPC to decode a hex input script. The returned object is:
That "p2sh" return value is the address of a P2SH with the hex input script as the redeem script.
If the input script is already a P2SH script, this doesn't make sense (we can't wrap a P2SH in a P2SH). Only return a P2SH address if the input script is not a P2SH script.