Skip to content

Change the way invalid ProTxes are handled in addUnchecked and existsProviderTxConflict#2691

Merged
codablock merged 2 commits into
dashpay:developfrom
UdjinM6:dropasserts
Feb 6, 2019
Merged

Change the way invalid ProTxes are handled in addUnchecked and existsProviderTxConflict#2691
codablock merged 2 commits into
dashpay:developfrom
UdjinM6:dropasserts

Conversation

@UdjinM6

@UdjinM6 UdjinM6 commented Feb 6, 2019

Copy link
Copy Markdown

The former is for idealogical reasons mainly, the later is for safety ones.

@UdjinM6 UdjinM6 added this to the 14.0 milestone Feb 6, 2019
@UdjinM6 UdjinM6 changed the title Drop asserts from addUnchecked and existsProviderTxConflict Change the way invalid ProTxes are handled in addUnchecked and existsProviderTxConflict Feb 6, 2019

@codablock codablock left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Comment thread src/txmempool.cpp
LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString());
return false;
}
bool ok = GetTxPayload(tx, proTx);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer bool valid

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yepp, agree. true could for example also be returned when a version (or any other integer) field is horribly out of range.

Comment thread src/txmempool.cpp
LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString());
return false;
}
bool ok = GetTxPayload(tx, proTx);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Comment thread src/txmempool.cpp
LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString());
return false;
}
bool ok = GetTxPayload(tx, proTx);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Comment thread src/txmempool.cpp
LogPrintf("%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString());
return false;
}
bool ok = GetTxPayload(tx, proTx);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@codablock
codablock merged commit 00f904e into dashpay:develop Feb 6, 2019
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
@UdjinM6
UdjinM6 deleted the dropasserts branch November 26, 2020 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants