mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-11 20:30:27 +02:00
p2p, refactor: Extend logs for unexpected sendtxrcncl
This commit is contained in:
parent
87493e112e
commit
14263c13f1
@ -3526,6 +3526,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||||||
peer_txreconcl_version, remote_salt);
|
peer_txreconcl_version, remote_salt);
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case ReconciliationRegisterResult::NOT_FOUND:
|
case ReconciliationRegisterResult::NOT_FOUND:
|
||||||
|
LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "Ignore unexpected txreconciliation signal from peer=%d\n", pfrom.GetId());
|
||||||
|
break;
|
||||||
case ReconciliationRegisterResult::SUCCESS:
|
case ReconciliationRegisterResult::SUCCESS:
|
||||||
break;
|
break;
|
||||||
case ReconciliationRegisterResult::ALREADY_REGISTERED:
|
case ReconciliationRegisterResult::ALREADY_REGISTERED:
|
||||||
|
@ -155,6 +155,18 @@ class SendTxRcnclTest(BitcoinTestFramework):
|
|||||||
peer.send_message(sendtxrcncl_higher_version)
|
peer.send_message(sendtxrcncl_higher_version)
|
||||||
self.nodes[0].disconnect_p2ps()
|
self.nodes[0].disconnect_p2ps()
|
||||||
|
|
||||||
|
self.log.info('unexpected SENDTXRCNCL is ignored')
|
||||||
|
peer = self.nodes[0].add_p2p_connection(PeerNoVerack(), send_version=False, wait_for_verack=False)
|
||||||
|
old_version_msg = msg_version()
|
||||||
|
old_version_msg.nVersion = 70015
|
||||||
|
old_version_msg.strSubVer = P2P_SUBVERSION
|
||||||
|
old_version_msg.nServices = P2P_SERVICES
|
||||||
|
old_version_msg.relay = 1
|
||||||
|
peer.send_message(old_version_msg)
|
||||||
|
with self.nodes[0].assert_debug_log(['Ignore unexpected txreconciliation signal from peer=2']):
|
||||||
|
peer.send_message(create_sendtxrcncl_msg())
|
||||||
|
self.nodes[0].disconnect_p2ps()
|
||||||
|
|
||||||
self.log.info('sending SENDTXRCNCL after sending VERACK triggers a disconnect')
|
self.log.info('sending SENDTXRCNCL after sending VERACK triggers a disconnect')
|
||||||
peer = self.nodes[0].add_p2p_connection(P2PInterface())
|
peer = self.nodes[0].add_p2p_connection(P2PInterface())
|
||||||
with self.nodes[0].assert_debug_log(["sendtxrcncl received after verack"]):
|
with self.nodes[0].assert_debug_log(["sendtxrcncl received after verack"]):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user