Skip to content

Commit

Permalink
Add a few calls to TestCrash to test error handling on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Jan 28, 2019
1 parent 8537ce5 commit c1bbc1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qa/rpc-tests/importmulti.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self):
self.setup_clean_chain = True

def setup_network(self, split=False):
self.nodes = start_nodes(2, self.options.tmpdir)
self.nodes = start_nodes(2, self.options.tmpdir, extra_args=["-crash=1"])
self.is_network_split=False

def run_test (self):
Expand Down
5 changes: 5 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "validationinterface.h"
#include "versionbits.h"
#include "warnings.h"
#include "stacktraces.h"

#include "instantx.h"
#include "masternode-payments.h"
Expand Down Expand Up @@ -1189,6 +1190,10 @@ CAmount GetBlockSubsidy(int nPrevBits, int nPrevHeight, const Consensus::Params&
// Hard fork to reduce the block reward by 10 extra percent (allowing budget/superblocks)
CAmount nSuperblockPart = (nPrevHeight > consensusParams.nBudgetPaymentsStartBlock) ? nSubsidy/10 : 0;

if (GetBoolArg("-crash", false)) {
TestCrash();
}

return fSuperblockPartOnly ? nSuperblockPart : nSubsidy - nSuperblockPart;
}

Expand Down

0 comments on commit c1bbc1d

Please sign in to comment.