Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_p2p_compactblocks.py
Show All 27 Lines | from test_framework.messages import ( | ||||
CTxIn, | CTxIn, | ||||
CTxOut, | CTxOut, | ||||
HeaderAndShortIDs, | HeaderAndShortIDs, | ||||
msg_cmpctblock, | msg_cmpctblock, | ||||
msg_sendcmpct, | msg_sendcmpct, | ||||
ser_compact_size, | ser_compact_size, | ||||
) | ) | ||||
from test_framework.mininode import ( | from test_framework.mininode import ( | ||||
mininode_lock, | p2p_lock, | ||||
P2PDataStore, | P2PDataStore, | ||||
P2PInterface, | P2PInterface, | ||||
) | ) | ||||
from test_framework.script import CScript, OP_RETURN, OP_TRUE | from test_framework.script import CScript, OP_RETURN, OP_TRUE | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.txtools import pad_tx | from test_framework.txtools import pad_tx | ||||
from test_framework.util import ( | from test_framework.util import ( | ||||
assert_equal, | assert_equal, | ||||
Show All 30 Lines | def on_getheaders(self, message): | ||||
self.last_getheaders = message | self.last_getheaders = message | ||||
def on_headers(self, message): | def on_headers(self, message): | ||||
self.last_headers = message | self.last_headers = message | ||||
for x in self.last_headers.headers: | for x in self.last_headers.headers: | ||||
x.calc_sha256() | x.calc_sha256() | ||||
def clear_block_data(self): | def clear_block_data(self): | ||||
with mininode_lock: | with p2p_lock: | ||||
self.last_sendcmpct = None | self.last_sendcmpct = None | ||||
self.last_cmpctblock = None | self.last_cmpctblock = None | ||||
class FullBlockTest(BitcoinTestFramework): | class FullBlockTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines |