Change the way invalid ProTxes are handled in addUnchecked and existsProviderTxConflict#2691
Merged
Merged
Conversation
asserts from addUnchecked and existsProviderTxConflictaddUnchecked and existsProviderTxConflict
| LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString()); | ||
| return false; | ||
| } | ||
| bool ok = GetTxPayload(tx, proTx); |
Member
There was a problem hiding this comment.
I would prefer bool valid
Author
There was a problem hiding this comment.
IMO valid would be confusing because GetTxPayload doesn't validate anything, it just trying to deserialize things. So success is the proper one, but ok is shorter :)
There was a problem hiding this comment.
Yepp, agree. true could for example also be returned when a version (or any other integer) field is horribly out of range.
| LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString()); | ||
| return false; | ||
| } | ||
| bool ok = GetTxPayload(tx, proTx); |
| LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString()); | ||
| return false; | ||
| } | ||
| bool ok = GetTxPayload(tx, proTx); |
| LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString()); | ||
| return false; | ||
| } | ||
| bool ok = GetTxPayload(tx, proTx); |
codablock
pushed a commit
to codablock/dash
that referenced
this pull request
Feb 6, 2019
…stsProviderTxConflict` (dashpay#2691) * Invalid ProTxes should never reach addUnchecked * Invalid ProTxes should not cause existsProviderTxConflict to crash
CryptoCentric
pushed a commit
to absolute-community/absolute
that referenced
this pull request
Jun 29, 2020
…stsProviderTxConflict` (dashpay#2691) * Invalid ProTxes should never reach addUnchecked * Invalid ProTxes should not cause existsProviderTxConflict to crash
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.
The former is for idealogical reasons mainly, the later is for safety ones.