Skip to content

Commit c3008c5

Browse files
committed
Add a few calls to TestCrash to test error handling on Travis
1 parent 8537ce5 commit c3008c5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

qa/rpc-tests/importmulti.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self):
1313
self.setup_clean_chain = True
1414

1515
def setup_network(self, split=False):
16-
self.nodes = start_nodes(2, self.options.tmpdir)
16+
self.nodes = start_nodes(2, self.options.tmpdir, extra_args=[["-crash=1"]] * self.num_nodes)
1717
self.is_network_split=False
1818

1919
def run_test (self):

src/validation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "validationinterface.h"
3838
#include "versionbits.h"
3939
#include "warnings.h"
40+
#include "stacktraces.h"
4041

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

1193+
if (GetBoolArg("-crash", false)) {
1194+
TestCrash();
1195+
}
1196+
11921197
return fSuperblockPartOnly ? nSuperblockPart : nSubsidy - nSuperblockPart;
11931198
}
11941199

0 commit comments

Comments
 (0)