Skip to content

Commit

Permalink
Add define constants
Browse files Browse the repository at this point in the history
  • Loading branch information
blondfrogs committed Jul 7, 2020
1 parent 405e1ee commit e889065
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
#define MICRO 0.000001
#define MILLI 0.001

#define CHECK_DUPLICATE_TRANSACTION_TRUE true
#define CHECK_DUPLICATE_TRANSACTION_FALSE false
#define CHECK_MEMPOOL_TRANSACTION_TRUE true
#define CHECK_MEMPOOL_TRANSACTION_FALSE false
#define CHECK_BLOCK_TRANSACTION_TRUE true
#define CHECK_BLOCK_TRANSACTION_FALSE false

/**
* Global state
*/
Expand Down Expand Up @@ -3999,16 +4006,16 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
return state.DoS(100, false, REJECT_INVALID, "bad-cb-multiple", false, "more than one coinbase");

// Check transactions
bool fCheckBlock = true;
bool fCheckDuplicates = true;
bool fCheckMempool = false;
bool fCheckBlock = CHECK_BLOCK_TRANSACTION_TRUE;
bool fCheckDuplicates = CHECK_DUPLICATE_TRANSACTION_TRUE;
bool fCheckMempool = CHECK_MEMPOOL_TRANSACTION_FALSE;
for (const auto& tx : block.vtx) {
// We only want to check the blocks when they are added to our chain
// We want to make sure when nodes shutdown and restart that they still
// verify the blocks in the database correctly even if Enforce Value BIP is active
fCheckBlock = true;
fCheckBlock = CHECK_BLOCK_TRANSACTION_TRUE;
if (fDBCheck){
fCheckBlock = false;
fCheckBlock = CHECK_BLOCK_TRANSACTION_FALSE;
}

if (!CheckTransaction(*tx, state, fCheckDuplicates, fCheckMempool, fCheckBlock))
Expand Down

0 comments on commit e889065

Please sign in to comment.