diff --git a/doc/bips.md b/doc/bips.md --- a/doc/bips.md +++ b/doc/bips.md @@ -15,7 +15,7 @@ * [`BIP 35`](https://github.com/bitcoin/bips/blob/master/bip-0035.mediawiki): The 'mempool' protocol message (and the protocol version bump to 60002) has been implemented since **v0.7.0** ([PR #1641](https://github.com/bitcoin/bitcoin/pull/1641)). * [`BIP 37`](https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki): The bloom filtering for transaction relaying, partial Merkle trees for blocks, and the protocol version bump to 70001 (enabling low-bandwidth SPV clients) has been implemented since **v0.8.0** ([PR #1795](https://github.com/bitcoin/bitcoin/pull/1795)). * [`BIP 42`](https://github.com/bitcoin/bips/blob/master/bip-0042.mediawiki): The bug that would have caused the subsidy schedule to resume after block 13440000 was fixed in **v0.9.2** ([PR #3842](https://github.com/bitcoin/bitcoin/pull/3842)). -* [`BIP 61`](https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki): The 'reject' protocol message (and the protocol version bump to 70002) was added in **v0.9.0** ([PR #3185](https://github.com/bitcoin/bitcoin/pull/3185)). Starting *v0.17.0*, whether to send reject messages can be configured with the `-enablebip61` option. +* [`BIP 61`](https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki): The 'reject' protocol message (and the protocol version bump to 70002) was added in **v0.9.0** ([PR #3185](https://github.com/bitcoin/bitcoin/pull/3185)). Starting **v0.19.11**, whether to send reject messages can be configured with the `-enablebip61` option, and support is deprecated (disabled by default) as of **0.21.9**. Support was removed in **v0.22.5** ([PR #15437](https://github.com/bitcoin/bitcoin/pull/15437)). * [`BIP 65`](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki): The CHECKLOCKTIMEVERIFY softfork was merged in **v0.12.0** ([PR #6351](https://github.com/bitcoin/bitcoin/pull/6351)), and backported to **v0.11.2** and **v0.10.4**. Mempool-only CLTV was added in [PR #6124](https://github.com/bitcoin/bitcoin/pull/6124). * [`BIP 66`](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki): The strict DER rules and associated version 3 blocks have been implemented since **v0.10.0** ([PR #5713](https://github.com/bitcoin/bitcoin/pull/5713)). * [`BIP 68`](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki): Sequence locks have been implemented as of **v0.12.1** ([PR #7184](https://github.com/bitcoin/bitcoin/pull/7184)), and have been activated since *block 419328*. diff --git a/doc/release-notes.md b/doc/release-notes.md --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -20,3 +20,38 @@ - The `-debug=db` logging category, which was deprecated in 0.22.4 and replaced by `-debug=walletdb` to distinguish it from `coindb`, has been removed. + +P2P and network changes +----------------------- + +#### Removal of reject network messages from Bitcoin ABC (BIP61) + +The command line option to enable BIP61 (`-enablebip61`) has been removed. + +This feature has been disabled by default since Bitcoin ABC version 0.21.9. +Nodes on the network can not generally be trusted to send valid ("reject") +messages, so this should only ever be used when connected to a trusted node. +Please use the recommended alternatives if you rely on this deprecated feature: + +* Testing or debugging of implementations of the Bitcoin P2P network protocol + should be done by inspecting the log messages that are produced by a recent + version of Bitcoin ABC. Bitcoin ABC logs debug messages + (`-debug=`) to a stream (`-printtoconsole`) or to a file + (`-debuglogfile=`). + +* Testing the validity of a block can be achieved by specific RPCs: + - `submitblock` + - `getblocktemplate` with `'mode'` set to `'proposal'` for blocks with + potentially invalid POW + +* Testing the validity of a transaction can be achieved by specific RPCs: + - `sendrawtransaction` + - `testmempoolaccept` + +* Wallets should not use the absence of "reject" messages to indicate a + transaction has propagated the network, nor should wallets use "reject" + messages to set transaction fees. Wallets should rather use fee estimation + to determine transaction fees and set replace-by-fee if desired. Thus, they + could wait until the transaction has confirmed (taking into account the fee + target they set (compare the RPC `estimatesmartfee`)) or listen for the + transaction announcement by other network peers to check for propagation. diff --git a/src/avalanche/test/processor_tests.cpp b/src/avalanche/test/processor_tests.cpp --- a/src/avalanche/test/processor_tests.cpp +++ b/src/avalanche/test/processor_tests.cpp @@ -237,7 +237,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); Processor p(connman.get()); std::vector updates; @@ -402,7 +402,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); Processor p(connman.get()); CBlockIndex indexA, indexB; @@ -513,7 +513,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); Processor p(connman.get()); @@ -661,7 +661,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); Processor p(connman.get()); @@ -724,7 +724,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); Processor p(connman.get()); @@ -790,7 +790,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); Processor p(connman.get()); std::vector updates; @@ -866,7 +866,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); Processor p(connman.get()); CScheduler s; diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -595,10 +595,6 @@ "Query for peer addresses via DNS lookup, if low on addresses " "(default: 1 unless -connect used)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); - gArgs.AddArg("-enablebip61", - strprintf("Send reject messages per BIP61 (default: %u)", - DEFAULT_ENABLE_BIP61), - ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); gArgs.AddArg("-externalip=", "Specify your own public address", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); @@ -2195,8 +2191,7 @@ GetRand(std::numeric_limits::max())); node.peer_logic.reset(new PeerLogicValidation( - node.connman.get(), node.banman.get(), *node.scheduler, - gArgs.GetBoolArg("-enablebip61", DEFAULT_ENABLE_BIP61))); + node.connman.get(), node.banman.get(), *node.scheduler)); RegisterValidationInterface(node.peer_logic.get()); // sanitize comments per BIP-0014, format user agent and check total size diff --git a/src/net_processing.h b/src/net_processing.h --- a/src/net_processing.h +++ b/src/net_processing.h @@ -26,21 +26,17 @@ */ static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100; -/** Default for BIP61 (sending reject messages) */ -static constexpr bool DEFAULT_ENABLE_BIP61{false}; - class PeerLogicValidation final : public CValidationInterface, public NetEventsInterface { private: CConnman *const connman; BanMan *const m_banman; - bool SendRejectsAndCheckIfBanned(CNode *pnode, bool enable_bip61) - EXCLUSIVE_LOCKS_REQUIRED(cs_main); + bool CheckIfBanned(CNode *pnode) EXCLUSIVE_LOCKS_REQUIRED(cs_main); public: PeerLogicValidation(CConnman *connman, BanMan *banman, - CScheduler &scheduler, bool enable_bip61); + CScheduler &scheduler); /** * Overridden from CValidationInterface. @@ -115,9 +111,6 @@ private: //! Next time to check for stale tip int64_t m_stale_tip_check_time; - - /** Enable BIP61 (sending reject messages) */ - const bool m_enable_bip61; }; struct CNodeStateStats { diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -257,12 +257,6 @@ } // namespace namespace { -struct CBlockReject { - uint8_t chRejectCode; - std::string strRejectReason; - uint256 hashBlock; -}; - /** * Maintain validation-specific state about nodes, protected by cs_main, instead * by CNode's own locks. This simplifies asynchronous operation, where @@ -281,9 +275,6 @@ bool m_should_discourage; //! String name of this peer (debugging/logging purposes). const std::string name; - //! List of asynchronously-determined block rejections to notify this peer - //! about. - std::vector rejects; //! The best known block we know this peer has announced. const CBlockIndex *pindexBestKnownBlock; //! The hash of the last unknown block this peer has announced. @@ -1340,10 +1331,8 @@ } PeerLogicValidation::PeerLogicValidation(CConnman *connmanIn, BanMan *banman, - CScheduler &scheduler, - bool enable_bip61) - : connman(connmanIn), m_banman(banman), m_stale_tip_check_time(0), - m_enable_bip61(enable_bip61) { + CScheduler &scheduler) + : connman(connmanIn), m_banman(banman), m_stale_tip_check_time(0) { // Initialize global variables that cannot be constructed at startup. recentRejects.reset(new CRollingBloomFilter(120000, 0.000001)); @@ -1524,11 +1513,6 @@ if (it != mapBlockSource.end() && State(it->second.first) && state.GetRejectCode() > 0 && state.GetRejectCode() < REJECT_INTERNAL) { - CBlockReject reject = { - uint8_t(state.GetRejectCode()), - state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), - hash}; - State(it->second.first)->rejects.push_back(reject); MaybePunishNodeForBlock(/*nodeid=*/it->second.first, state, /*via_compact_block=*/!it->second.second); } @@ -2250,8 +2234,7 @@ const std::string &strCommand, CDataStream &vRecv, int64_t nTimeReceived, CConnman *connman, BanMan *banman, - const std::atomic &interruptMsgProc, - bool enable_bip61) { + const std::atomic &interruptMsgProc) { const CChainParams &chainparams = config.GetChainParams(); LogPrint(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(strCommand), vRecv.size(), pfrom->GetId()); @@ -2274,44 +2257,9 @@ } } - if (strCommand == NetMsgType::REJECT) { - if (LogAcceptCategory(BCLog::NET)) { - try { - std::string strMsg; - uint8_t ccode; - std::string strReason; - vRecv >> LIMITED_STRING(strMsg, CMessageHeader::COMMAND_SIZE) >> - ccode >> - LIMITED_STRING(strReason, MAX_REJECT_MESSAGE_LENGTH); - - std::ostringstream ss; - ss << strMsg << " code " << itostr(ccode) << ": " << strReason; - - if (strMsg == NetMsgType::BLOCK || strMsg == NetMsgType::TX) { - uint256 hash; - vRecv >> hash; - ss << ": hash " << hash.ToString(); - } - LogPrint(BCLog::NET, "Reject %s\n", SanitizeString(ss.str())); - } catch (const std::ios_base::failure &) { - // Avoid feedback loops by preventing reject messages from - // triggering a new reject message. - LogPrint(BCLog::NET, "Unparseable reject message received\n"); - } - } - return true; - } - if (strCommand == NetMsgType::VERSION) { // Each connection can only send one version message if (pfrom->nVersion != 0) { - if (enable_bip61) { - connman->PushMessage( - pfrom, - CNetMsgMaker(INIT_PROTO_VERSION) - .Make(NetMsgType::REJECT, strCommand, REJECT_DUPLICATE, - std::string("Duplicate version message"))); - } LOCK(cs_main); Misbehaving(pfrom, 1, "multiple-version"); return false; @@ -2343,15 +2291,6 @@ "(%08x offered, %08x expected); disconnecting\n", pfrom->GetId(), nServices, GetDesirableServiceFlags(nServices)); - if (enable_bip61) { - connman->PushMessage( - pfrom, - CNetMsgMaker(INIT_PROTO_VERSION) - .Make(NetMsgType::REJECT, strCommand, - REJECT_NONSTANDARD, - strprintf("Expected to offer services %08x", - GetDesirableServiceFlags(nServices)))); - } pfrom->fDisconnect = true; return false; } @@ -2361,14 +2300,6 @@ LogPrint(BCLog::NET, "peer=%d using obsolete version %i; disconnecting\n", pfrom->GetId(), nVersion); - if (enable_bip61) { - connman->PushMessage( - pfrom, - CNetMsgMaker(INIT_PROTO_VERSION) - .Make(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE, - strprintf("Version must be %d or greater", - MIN_PEER_PROTO_VERSION))); - } pfrom->fDisconnect = true; return false; } @@ -3123,16 +3054,6 @@ "%s from peer=%d was not accepted: %s\n", tx.GetHash().ToString(), pfrom->GetId(), FormatStateMessage(state)); - // Never send AcceptToMemoryPool's internal codes over P2P - if (enable_bip61 && state.GetRejectCode() > 0 && - state.GetRejectCode() < REJECT_INTERNAL) { - connman->PushMessage( - pfrom, msgMaker.Make(NetMsgType::REJECT, strCommand, - uint8_t(state.GetRejectCode()), - state.GetRejectReason().substr( - 0, MAX_REJECT_MESSAGE_LENGTH), - inv.hash)); - } MaybePunishNodeForTx(pfrom->GetId(), state); } return true; @@ -3357,7 +3278,7 @@ if (fProcessBLOCKTXN) { return ProcessMessage(config, pfrom, NetMsgType::BLOCKTXN, blockTxnMsg, nTimeReceived, connman, banman, - interruptMsgProc, enable_bip61); + interruptMsgProc); } if (fRevertToHeaderProcessing) { @@ -3967,24 +3888,10 @@ return true; } -bool PeerLogicValidation::SendRejectsAndCheckIfBanned(CNode *pnode, - bool enable_bip61) - EXCLUSIVE_LOCKS_REQUIRED(cs_main) { +bool PeerLogicValidation::CheckIfBanned(CNode *pnode) { AssertLockHeld(cs_main); CNodeState &state = *State(pnode->GetId()); - if (enable_bip61) { - for (const CBlockReject &reject : state.rejects) { - connman->PushMessage( - pnode, - CNetMsgMaker(INIT_PROTO_VERSION) - .Make(NetMsgType::REJECT, std::string(NetMsgType::BLOCK), - reject.chRejectCode, reject.strRejectReason, - reject.hashBlock)); - } - } - state.rejects.clear(); - if (state.m_should_discourage) { state.m_should_discourage = false; if (pnode->HasPermission(PF_NOBAN)) { @@ -4126,9 +4033,8 @@ // Process message bool fRet = false; try { - fRet = - ProcessMessage(config, pfrom, strCommand, vRecv, msg.nTime, connman, - m_banman, interruptMsgProc, m_enable_bip61); + fRet = ProcessMessage(config, pfrom, strCommand, vRecv, msg.nTime, + connman, m_banman, interruptMsgProc); if (interruptMsgProc) { return false; } @@ -4137,13 +4043,6 @@ fMoreWork = true; } } catch (const std::ios_base::failure &e) { - if (m_enable_bip61) { - connman->PushMessage( - pfrom, - CNetMsgMaker(INIT_PROTO_VERSION) - .Make(NetMsgType::REJECT, strCommand, REJECT_MALFORMED, - std::string("error parsing message"))); - } if (strstr(e.what(), "end of data")) { // Allow exceptions from under-length message on vRecv LogPrint(BCLog::NET, @@ -4176,7 +4075,7 @@ } LOCK(cs_main); - SendRejectsAndCheckIfBanned(pfrom, m_enable_bip61); + CheckIfBanned(pfrom); return fMoreWork; } @@ -4441,13 +4340,12 @@ } } - // Acquire cs_main for IsInitialBlockDownload() and CNodeState() TRY_LOCK(cs_main, lockMain); if (!lockMain) { return true; } - if (SendRejectsAndCheckIfBanned(pto, m_enable_bip61)) { + if (CheckIfBanned(pto)) { return true; } CNodeState &state = *State(pto->GetId()); diff --git a/src/protocol.h b/src/protocol.h --- a/src/protocol.h +++ b/src/protocol.h @@ -212,13 +212,6 @@ * @see https://bitcoin.org/en/developer-reference#filterclear */ extern const char *FILTERCLEAR; -/** - * The reject message informs the receiving node that one of its previous - * messages has been rejected. - * @since protocol version 70002 as described by BIP61. - * @see https://bitcoin.org/en/developer-reference#reject - */ -extern const char *REJECT; /** * Indicates that a node prefers to receive new block announcements via a * "headers" message rather than an "inv". diff --git a/src/protocol.cpp b/src/protocol.cpp --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -37,7 +37,6 @@ const char *FILTERLOAD = "filterload"; const char *FILTERADD = "filteradd"; const char *FILTERCLEAR = "filterclear"; -const char *REJECT = "reject"; const char *SENDHEADERS = "sendheaders"; const char *FEEFILTER = "feefilter"; const char *SENDCMPCT = "sendcmpct"; @@ -59,15 +58,15 @@ * above and in protocol.h. */ static const std::string allNetMessageTypes[] = { - NetMsgType::VERSION, NetMsgType::VERACK, NetMsgType::ADDR, - NetMsgType::INV, NetMsgType::GETDATA, NetMsgType::MERKLEBLOCK, - NetMsgType::GETBLOCKS, NetMsgType::GETHEADERS, NetMsgType::TX, - NetMsgType::HEADERS, NetMsgType::BLOCK, NetMsgType::GETADDR, - NetMsgType::MEMPOOL, NetMsgType::PING, NetMsgType::PONG, - NetMsgType::NOTFOUND, NetMsgType::FILTERLOAD, NetMsgType::FILTERADD, - NetMsgType::FILTERCLEAR, NetMsgType::REJECT, NetMsgType::SENDHEADERS, - NetMsgType::FEEFILTER, NetMsgType::SENDCMPCT, NetMsgType::CMPCTBLOCK, - NetMsgType::GETBLOCKTXN, NetMsgType::BLOCKTXN, + NetMsgType::VERSION, NetMsgType::VERACK, NetMsgType::ADDR, + NetMsgType::INV, NetMsgType::GETDATA, NetMsgType::MERKLEBLOCK, + NetMsgType::GETBLOCKS, NetMsgType::GETHEADERS, NetMsgType::TX, + NetMsgType::HEADERS, NetMsgType::BLOCK, NetMsgType::GETADDR, + NetMsgType::MEMPOOL, NetMsgType::PING, NetMsgType::PONG, + NetMsgType::NOTFOUND, NetMsgType::FILTERLOAD, NetMsgType::FILTERADD, + NetMsgType::FILTERCLEAR, NetMsgType::SENDHEADERS, NetMsgType::FEEFILTER, + NetMsgType::SENDCMPCT, NetMsgType::CMPCTBLOCK, NetMsgType::GETBLOCKTXN, + NetMsgType::BLOCKTXN, }; static const std::vector allNetMessageTypesVec(allNetMessageTypes, diff --git a/src/test/denialofservice_tests.cpp b/src/test/denialofservice_tests.cpp --- a/src/test/denialofservice_tests.cpp +++ b/src/test/denialofservice_tests.cpp @@ -80,7 +80,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); // Mock an outbound peer CAddress addr1(ip(0xa0b0c001), NODE_NONE); @@ -164,7 +164,7 @@ auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), nullptr, *m_node.scheduler, false); + connman.get(), nullptr, *m_node.scheduler); const Consensus::Params &consensusParams = config.GetChainParams().GetConsensus(); @@ -243,7 +243,7 @@ DEFAULT_MISBEHAVING_BANTIME); auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), banman.get(), *m_node.scheduler, false); + connman.get(), banman.get(), *m_node.scheduler); banman->ClearBanned(); CAddress addr1(ip(0xa0b0c001), NODE_NONE); @@ -312,7 +312,7 @@ DEFAULT_MISBEHAVING_BANTIME); auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), banman.get(), *m_node.scheduler, false); + connman.get(), banman.get(), *m_node.scheduler); banman->ClearBanned(); // because 11 is my favorite number. @@ -369,7 +369,7 @@ DEFAULT_MISBEHAVING_BANTIME); auto connman = std::make_unique(config, 0x1337, 0x1337); auto peerLogic = std::make_unique( - connman.get(), banman.get(), *m_node.scheduler, false); + connman.get(), banman.get(), *m_node.scheduler); banman->ClearBanned(); int64_t nStartTime = GetTime(); diff --git a/src/validation.h b/src/validation.h --- a/src/validation.h +++ b/src/validation.h @@ -115,8 +115,6 @@ static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60; /** Time to wait (in seconds) between flushing chainstate to disk. */ static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60; -/** Maximum length of reject messages. */ -static const unsigned int MAX_REJECT_MESSAGE_LENGTH = 111; /** Block download timeout base, expressed in millionths of the block interval * (i.e. 10 min) */ static const int64_t BLOCK_DOWNLOAD_TIMEOUT_BASE = 1000000; diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -34,9 +34,7 @@ CLTV_HEIGHT = 1351 # Reject codes that we might receive in this test -REJECT_INVALID = 16 REJECT_OBSOLETE = 17 -REJECT_NONSTANDARD = 64 def cltv_lock_to_height(node, tx, to_address, amount, height=-1): diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py --- a/test/functional/feature_dersig.py +++ b/test/functional/feature_dersig.py @@ -9,20 +9,15 @@ from test_framework.blocktools import create_block, create_coinbase, create_transaction from test_framework.messages import msg_block -from test_framework.mininode import ( - mininode_lock, - P2PInterface, -) +from test_framework.mininode import P2PInterface from test_framework.script import CScript from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, wait_until +from test_framework.util import assert_equal DERSIG_HEIGHT = 1251 # Reject codes that we might receive in this test -REJECT_INVALID = 16 REJECT_OBSOLETE = 17 -REJECT_NONSTANDARD = 64 # A canonical signature consists of: # <30> <02> <02> @@ -46,7 +41,7 @@ class BIP66Test(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 - self.extra_args = [['-whitelist=127.0.0.1', '-enablebip61']] + self.extra_args = [['-whitelist=127.0.0.1']] self.setup_clean_chain = True self.rpc_timeout = 120 @@ -104,15 +99,6 @@ assert_equal(self.nodes[0].getbestblockhash(), tip) self.nodes[0].p2p.sync_with_ping() - wait_until(lambda: "reject" in self.nodes[0].p2p.last_message.keys(), - lock=mininode_lock) - with mininode_lock: - assert self.nodes[0].p2p.last_message["reject"].code in [ - REJECT_INVALID, REJECT_NONSTANDARD] - assert_equal( - self.nodes[0].p2p.last_message["reject"].data, block.sha256) - assert b'blk-bad-inputs' in self.nodes[0].p2p.last_message["reject"].reason - self.log.info( "Test that a version 3 block with a DERSIG-compliant transaction is accepted") block.vtx[1] = create_transaction(self.nodes[0], diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -1291,39 +1291,6 @@ return "msg_headers(headers={})".format(repr(self.headers)) -class msg_reject: - __slots__ = ("code", "data", "message", "reason") - command = b"reject" - REJECT_MALFORMED = 1 - - def __init__(self): - self.message = b"" - self.code = 0 - self.reason = b"" - self.data = 0 - - def deserialize(self, f): - self.message = deser_string(f) - self.code = struct.unpack("