mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +02:00
[tests] Add P2PDataStore class
P2PDataStore subclasses NodeConnCB. This class keeps a store of txs and blocks and responds to getdata requests from the node-under-test.
This commit is contained in:
@@ -44,6 +44,11 @@ NODE_UNSUPPORTED_SERVICE_BIT_5 = (1 << 5)
|
||||
NODE_UNSUPPORTED_SERVICE_BIT_7 = (1 << 7)
|
||||
NODE_NETWORK_LIMITED = (1 << 10)
|
||||
|
||||
MSG_TX = 1
|
||||
MSG_BLOCK = 2
|
||||
MSG_WITNESS_FLAG = 1 << 30
|
||||
MSG_TYPE_MASK = 0xffffffff >> 2
|
||||
|
||||
# Serialization/deserialization tools
|
||||
def sha256(s):
|
||||
return hashlib.new('sha256', s).digest()
|
||||
@@ -204,8 +209,6 @@ class CAddress():
|
||||
return "CAddress(nServices=%i ip=%s port=%i)" % (self.nServices,
|
||||
self.ip, self.port)
|
||||
|
||||
MSG_WITNESS_FLAG = 1<<30
|
||||
|
||||
class CInv():
|
||||
typemap = {
|
||||
0: "Error",
|
||||
|
Reference in New Issue
Block a user