mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-01 16:31:33 +01:00
[tests] Make NodeConnCB a subclass of NodeConn
This makes NodeConnCB a subclass of NodeConn, and removes the need for the client code to know anything about the implementation details of NodeConnCB. NodeConn can now be swapped out for any other implementation of a low-level connection without changing client code.
This commit is contained in:
@@ -27,7 +27,7 @@ class TestNode(NodeConnCB):
|
||||
super().__init__()
|
||||
self.txinvs = []
|
||||
|
||||
def on_inv(self, conn, message):
|
||||
def on_inv(self, message):
|
||||
for i in message.inv:
|
||||
if (i.type == 1):
|
||||
self.txinvs.append(hashToHex(i.hash))
|
||||
|
||||
Reference in New Issue
Block a user