diff --git a/qa/rpc-tests/feature_fedpeg.py b/qa/rpc-tests/feature_fedpeg.py index 2614a9a124..282d8de8c7 100755 --- a/qa/rpc-tests/feature_fedpeg.py +++ b/qa/rpc-tests/feature_fedpeg.py @@ -97,6 +97,7 @@ class FedPegTest(BitcoinTestFramework): '-peginconfirmationdepth=10', '-mainchainrpchost=127.0.0.1', '-mainchainrpcport=%s' % rpc_port(n), + '-recheckpeginblockinterval=15', # Long enough to allow failure and repair before timeout ] if not self.options.parent_bitcoin: args.extend([ @@ -319,12 +320,13 @@ class FedPegTest(BitcoinTestFramework): self.nodes[1] = start_node(1, self.options.tmpdir, self.extra_args[1], binary=self.binary, chain=self.parent_chain, cookie_auth=True) parent2 = self.nodes[1] connect_nodes_bi(self.nodes, 0, 1) - time.sleep(5) # Don't make a block, race condition when pegin-invalid block # is awaiting further validation, nodes reject subsequent blocks # even ones they create + print("Now waiting for node to re-evaluate peg-in witness failed block... should take a few seconds") self.sync_all() + print("Completed!\n") print("Now send funds out in two stages, partial, and full") some_btc_addr = get_new_unconfidential_address(parent) bal_1 = sidechain.getwalletinfo()["balance"]["bitcoin"] diff --git a/src/validation.cpp b/src/validation.cpp index f3425b77a4..4b00af0efa 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1870,7 +1870,7 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins if (tx.vin[i].m_is_pegin) { // Check existence and validity of pegin witness if (tx.wit.vtxinwit.size() <= i || !IsValidPeginWitness(tx.wit.vtxinwit[i].m_pegin_witness, prevout)) { - return state.DoS(0, false, REJECT_PEGIN, "bad-pegin-witness", true); + return state.DoS(0, false, REJECT_PEGIN, "bad-pegin-witness"); } std::pair pegin = std::make_pair(uint256(tx.wit.vtxinwit[i].m_pegin_witness.stack[2]), prevout); if (inputs.IsWithdrawSpent(pegin)) {