mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
remove MyNodeConnCB Class and references
Signed-off-by: Pasta <pasta@dashboost.org>
This commit is contained in:
parent
2d771c95a1
commit
05139e3eb4
@ -89,26 +89,7 @@ class P2PFingerprintTest(BitcoinTestFramework):
|
|||||||
# This does not currently test that stale blocks timestamped within the
|
# This does not currently test that stale blocks timestamped within the
|
||||||
# last month but that have over a month's worth of work are also withheld.
|
# last month but that have over a month's worth of work are also withheld.
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
# TODO remove this when mininode is up-to-date with Bitcoin
|
node0 = NodeConnCB()
|
||||||
class MyNodeConnCB(NodeConnCB):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__()
|
|
||||||
self.cond = threading.Condition()
|
|
||||||
self.last_message = {}
|
|
||||||
|
|
||||||
def deliver(self, conn, message):
|
|
||||||
super().deliver(conn, message)
|
|
||||||
command = message.command.decode('ascii')
|
|
||||||
self.last_message[command] = message
|
|
||||||
with self.cond:
|
|
||||||
self.cond.notify_all()
|
|
||||||
|
|
||||||
def wait_for_getdata(self):
|
|
||||||
with self.cond:
|
|
||||||
assert(self.cond.wait_for(lambda: "getdata" in self.last_message, timeout=15))
|
|
||||||
|
|
||||||
|
|
||||||
node0 = MyNodeConnCB()
|
|
||||||
|
|
||||||
connections = []
|
connections = []
|
||||||
connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], node0))
|
connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], node0))
|
||||||
|
Loading…
Reference in New Issue
Block a user