mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
Fix p2p-fingerprint.py
This commit is contained in:
parent
92fed92540
commit
6f91144f22
@ -16,7 +16,7 @@ from test_framework.mininode import (
|
|||||||
CInv,
|
CInv,
|
||||||
NetworkThread,
|
NetworkThread,
|
||||||
NodeConn,
|
NodeConn,
|
||||||
SingleNodeConnCB,
|
NodeConnCB,
|
||||||
msg_headers,
|
msg_headers,
|
||||||
msg_block,
|
msg_block,
|
||||||
msg_getdata,
|
msg_getdata,
|
||||||
@ -90,14 +90,14 @@ class P2PFingerprintTest(BitcoinTestFramework):
|
|||||||
# 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
|
# TODO remove this when mininode is up-to-date with Bitcoin
|
||||||
class MyNodeConnCB(SingleNodeConnCB):
|
class MyNodeConnCB(NodeConnCB):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
SingleNodeConnCB.__init__(self)
|
super().__init__()
|
||||||
self.cond = threading.Condition()
|
self.cond = threading.Condition()
|
||||||
self.last_message = {}
|
self.last_message = {}
|
||||||
|
|
||||||
def deliver(self, conn, message):
|
def deliver(self, conn, message):
|
||||||
SingleNodeConnCB.deliver(self, conn, message)
|
super().deliver(conn, message)
|
||||||
command = message.command.decode('ascii')
|
command = message.command.decode('ascii')
|
||||||
self.last_message[command] = message
|
self.last_message[command] = message
|
||||||
with self.cond:
|
with self.cond:
|
||||||
|
Loading…
Reference in New Issue
Block a user