mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-04 10:59:08 +02:00
[test] Move MAGIC_BYTES to messages.py
This avoids circular dependency happening when importing MAGIC_BYTES. Before, p2p.py <--import for EncryptedP2PState-- v2_p2p.py | ^ | | └---------import for MAGIC_BYTES----------┘ Now, MAGIC_BYTES are kept separately in messages.py Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
@@ -75,6 +75,13 @@ MAX_OP_RETURN_RELAY = 83
|
||||
|
||||
DEFAULT_MEMPOOL_EXPIRY_HOURS = 336 # hours
|
||||
|
||||
MAGIC_BYTES = {
|
||||
"mainnet": b"\xf9\xbe\xb4\xd9", # mainnet
|
||||
"testnet3": b"\x0b\x11\x09\x07", # testnet3
|
||||
"regtest": b"\xfa\xbf\xb5\xda", # regtest
|
||||
"signet": b"\x0a\x03\xcf\x40", # signet
|
||||
}
|
||||
|
||||
def sha256(s):
|
||||
return hashlib.sha256(s).digest()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user