|
|
|
@ -107,29 +107,33 @@ class SendTxRcnclTest(BitcoinTestFramework):
|
|
|
|
|
peer.send_message(create_sendtxrcncl_msg())
|
|
|
|
|
self.wait_until(lambda : "sendtxrcncl" in self.nodes[0].getpeerinfo()[-1]["bytesrecv_per_msg"])
|
|
|
|
|
self.log.info('second SENDTXRCNCL triggers a disconnect')
|
|
|
|
|
peer.send_message(create_sendtxrcncl_msg())
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
with self.nodes[0].assert_debug_log(["(sendtxrcncl received from already registered peer); disconnecting"]):
|
|
|
|
|
peer.send_message(create_sendtxrcncl_msg())
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
|
|
|
|
|
self.log.info('SENDTXRCNCL with initiator=responder=0 triggers a disconnect')
|
|
|
|
|
sendtxrcncl_no_role = create_sendtxrcncl_msg()
|
|
|
|
|
sendtxrcncl_no_role.initiator = False
|
|
|
|
|
sendtxrcncl_no_role.responder = False
|
|
|
|
|
peer = self.nodes[0].add_p2p_connection(PeerNoVerack(), send_version=True, wait_for_verack=False)
|
|
|
|
|
peer.send_message(sendtxrcncl_no_role)
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
with self.nodes[0].assert_debug_log(["txreconciliation protocol violation"]):
|
|
|
|
|
peer.send_message(sendtxrcncl_no_role)
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
|
|
|
|
|
self.log.info('SENDTXRCNCL with initiator=0 and responder=1 from inbound triggers a disconnect')
|
|
|
|
|
sendtxrcncl_wrong_role = create_sendtxrcncl_msg(initiator=False)
|
|
|
|
|
peer = self.nodes[0].add_p2p_connection(PeerNoVerack(), send_version=True, wait_for_verack=False)
|
|
|
|
|
peer.send_message(sendtxrcncl_wrong_role)
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
with self.nodes[0].assert_debug_log(["txreconciliation protocol violation"]):
|
|
|
|
|
peer.send_message(sendtxrcncl_wrong_role)
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
|
|
|
|
|
self.log.info('SENDTXRCNCL with version=0 triggers a disconnect')
|
|
|
|
|
sendtxrcncl_low_version = create_sendtxrcncl_msg()
|
|
|
|
|
sendtxrcncl_low_version.version = 0
|
|
|
|
|
peer = self.nodes[0].add_p2p_connection(PeerNoVerack(), send_version=True, wait_for_verack=False)
|
|
|
|
|
peer.send_message(sendtxrcncl_low_version)
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
with self.nodes[0].assert_debug_log(["txreconciliation protocol violation"]):
|
|
|
|
|
peer.send_message(sendtxrcncl_low_version)
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
|
|
|
|
|
self.log.info('sending SENDTXRCNCL after sending VERACK triggers a disconnect')
|
|
|
|
|
peer = self.nodes[0].add_p2p_connection(P2PInterface())
|
|
|
|
@ -162,8 +166,9 @@ class SendTxRcnclTest(BitcoinTestFramework):
|
|
|
|
|
self.log.info('SENDTXRCNCL if block-relay-only triggers a disconnect')
|
|
|
|
|
peer = self.nodes[0].add_outbound_p2p_connection(
|
|
|
|
|
PeerNoVerack(), wait_for_verack=False, p2p_idx=3, connection_type="block-relay-only")
|
|
|
|
|
peer.send_message(create_sendtxrcncl_msg(initiator=False))
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
with self.nodes[0].assert_debug_log(["we indicated no tx relay; disconnecting"]):
|
|
|
|
|
peer.send_message(create_sendtxrcncl_msg(initiator=False))
|
|
|
|
|
peer.wait_for_disconnect()
|
|
|
|
|
|
|
|
|
|
self.log.info('SENDTXRCNCL with initiator=1 and responder=0 from outbound triggers a disconnect')
|
|
|
|
|
sendtxrcncl_wrong_role = create_sendtxrcncl_msg(initiator=True)
|
|
|
|
|