mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 03:39:48 +02:00
Merge bitcoin/bitcoin#26359: p2p: Erlay support signaling follow-ups
46339d29b1test, refactor: Reorder sendtxrcncl tests for better readability (Gleb Naumenko)14263c13f1p2p, refactor: Extend logs for unexpected sendtxrcncl (Gleb Naumenko)87493e112ep2p, test, refactor: Minor code improvements (Gleb Naumenko)00c5dec818p2p: Clarify sendtxrcncl policies (Gleb Naumenko)ac6ee5ba21test: Expand unit and functional tests for txreconciliation (Gleb Naumenko)bc84e24a4fp2p, refactor: Switch to enum class for ReconciliationRegisterResult (Gleb Naumenko)a60f729e29p2p: Drop roles from sendtxrcncl (Gleb Naumenko)6772cbf69ctests: stabilize sendtxrcncl test (Gleb Naumenko) Pull request description: Non-trivial changes include: - Getting rid of roles in `sendtxrcncl` message (summarized in the [BIP PR](https://github.com/bitcoin/bips/pull/1376)); - Disconnect the peer if it send `sendtxrcncl` although we are in `blocksonly` and notified the peer with `fRelay=0`; - Don't send `sendtxrcncl` to feeler connections. ACKs for top commit: vasild: ACK46339d29b1ariard: ACK46339d2mzumsande: Code Review ACK46339d29b1Tree-SHA512: b5cc6934b4670c12b7dbb3189e739ef747ee542ec56678bf4e4355bfb481b746d32363c173635685b71969b3fe4bd52b1c8ebd3ea3b35c82044bba69220f6417
This commit is contained in:
@@ -1840,29 +1840,23 @@ class msg_cfcheckpt:
|
||||
self.filter_type, self.stop_hash)
|
||||
|
||||
class msg_sendtxrcncl:
|
||||
__slots__ = ("initiator", "responder", "version", "salt")
|
||||
__slots__ = ("version", "salt")
|
||||
msgtype = b"sendtxrcncl"
|
||||
|
||||
def __init__(self):
|
||||
self.initiator = False
|
||||
self.responder = False
|
||||
self.version = 0
|
||||
self.salt = 0
|
||||
|
||||
def deserialize(self, f):
|
||||
self.initiator = struct.unpack("<?", f.read(1))[0]
|
||||
self.responder = struct.unpack("<?", f.read(1))[0]
|
||||
self.version = struct.unpack("<I", f.read(4))[0]
|
||||
self.salt = struct.unpack("<Q", f.read(8))[0]
|
||||
|
||||
def serialize(self):
|
||||
r = b""
|
||||
r += struct.pack("<?", self.initiator)
|
||||
r += struct.pack("<?", self.responder)
|
||||
r += struct.pack("<I", self.version)
|
||||
r += struct.pack("<Q", self.salt)
|
||||
return r
|
||||
|
||||
def __repr__(self):
|
||||
return "msg_sendtxrcncl(initiator=%i, responder=%i, version=%lu, salt=%lu)" %\
|
||||
(self.initiator, self.responder, self.version, self.salt)
|
||||
return "msg_sendtxrcncl(version=%lu, salt=%lu)" %\
|
||||
(self.version, self.salt)
|
||||
|
||||
Reference in New Issue
Block a user