diff options
| author | Suhas Daftuar <[email protected]> | 2019-02-21 13:46:25 -0500 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2019-05-02 15:29:09 -0400 |
| commit | 54470e767bab37f9b7089782b1be73d5883bb244 (patch) | |
| tree | 93593dd9585f122caa07da630ace4931e1ef5d33 /src/net_processing.cpp | |
| parent | [refactor] Update some comments in validation.cpp as we arent doing DoS there (diff) | |
| download | discoin-54470e767bab37f9b7089782b1be73d5883bb244.tar.xz discoin-54470e767bab37f9b7089782b1be73d5883bb244.zip | |
Assert validation reasons are contextually correct
Diffstat (limited to 'src/net_processing.cpp')
| -rw-r--r-- | src/net_processing.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index c19befcf8..3319d3211 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -975,6 +975,7 @@ void Misbehaving(NodeId pnode, int howmuch, const std::string& message) EXCLUSIV */ static bool TxRelayMayResultInDisconnect(const CValidationState& state) { + assert(IsTransactionReason(state.GetReason())); return state.GetReason() == ValidationInvalidReason::CONSENSUS; } @@ -1806,6 +1807,7 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se // Has inputs but not accepted to mempool // Probably non-standard or insufficient fee LogPrint(BCLog::MEMPOOL, " removed orphan tx %s\n", orphanHash.ToString()); + assert(IsTransactionReason(orphan_state.GetReason())); if (!orphanTx.HasWitness() && orphan_state.GetReason() != ValidationInvalidReason::TX_WITNESS_MUTATED) { // Do not use rejection cache for witness transactions or // witness-stripped transactions, as they can have been malleated. @@ -2523,6 +2525,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr recentRejects->insert(tx.GetHash()); } } else { + assert(IsTransactionReason(state.GetReason())); if (!tx.HasWitness() && state.GetReason() != ValidationInvalidReason::TX_WITNESS_MUTATED) { // Do not use rejection cache for witness transactions or // witness-stripped transactions, as they can have been malleated. |