-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[rpc] ParseHash: Fail when length is not 64 #9042
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
Merged
Merged
Conversation
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
dcousens
reviewed
Oct 31, 2016
@@ -147,6 +147,8 @@ uint256 ParseHashV(const UniValue& v, string strName) | |||
strHex = v.get_str(); | |||
if (!IsHex(strHex)) // Note: IsHex("") is false | |||
throw JSONRPCError(RPC_INVALID_PARAMETER, strName+" must be hexadecimal string (not '"+strHex+"')"); | |||
if (256 / 4 != strHex.length()) |
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.
256 / 4
is more confusing than 32 * 2
or just 64
...
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.
fixed nit
fa6e0e1
to
fa32619
Compare
dcousens
approved these changes
Oct 31, 2016
Makes sense, utACK fa32619 |
laanwj
added a commit
that referenced
this pull request
Nov 2, 2016
fa32619 [rpc] ParseHash: Fail when length is not 64 (MarcoFalke)
luke-jr
pushed a commit
to luke-jr/bitcoin
that referenced
this pull request
Dec 2, 2016
Github-Pull: bitcoin#9042 Rebased-From: fa32619
codablock
pushed a commit
to codablock/dash
that referenced
this pull request
Jan 13, 2018
fa32619 [rpc] ParseHash: Fail when length is not 64 (MarcoFalke)
andvgal
pushed a commit
to energicryptocurrency/gen2-energi
that referenced
this pull request
Jan 6, 2019
fa32619 [rpc] ParseHash: Fail when length is not 64 (MarcoFalke)
CryptoCentric
pushed a commit
to absolute-community/absolute
that referenced
this pull request
Feb 15, 2019
fa32619 [rpc] ParseHash: Fail when length is not 64 (MarcoFalke)
gandrewstone
pushed a commit
to BitcoinUnlimited/BitcoinUnlimited
that referenced
this pull request
Mar 20, 2019
…ction (#1612) bitcoin/bitcoin#10275 bitcoin/bitcoin#9042 `GetTransaction` changes are easier to review ignoring whitespace changes (add `?w=1` to the PR's URL)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There have been a few complaints such as #9040... Maybe this helps to debug them further.
Of course this also makes it impossible to discard the "leading" zeros:
Before:
After: