Changeset View
Changeset View
Standalone View
Standalone View
qa/rpc-tests/p2p-versionbits-warning.py
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | def __init__(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
def setup_network(self): | def setup_network(self): | ||||
self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt") | self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt") | ||||
# Open and close to create zero-length file | # Open and close to create zero-length file | ||||
with open(self.alert_filename, 'w', encoding='utf8') as _: | with open(self.alert_filename, 'w', encoding='utf8') as _: | ||||
pass | pass | ||||
self.extra_args = [ | self.extra_args = [ | ||||
["-debug", "-logtimemicros=1", "-alertnotify=echo %s >> \"" + self.alert_filename + "\""]] | ["-alertnotify=echo %s >> \"" + self.alert_filename + "\""]] | ||||
self.nodes = start_nodes( | self.nodes = start_nodes( | ||||
self.num_nodes, self.options.tmpdir, self.extra_args) | self.num_nodes, self.options.tmpdir, self.extra_args) | ||||
# Send numblocks blocks via peer with nVersionToUse set. | # Send numblocks blocks via peer with nVersionToUse set. | ||||
def send_blocks_with_version(self, peer, numblocks, nVersionToUse): | def send_blocks_with_version(self, peer, numblocks, nVersionToUse): | ||||
tip = self.nodes[0].getbestblockhash() | tip = self.nodes[0].getbestblockhash() | ||||
height = self.nodes[0].getblockcount() | height = self.nodes[0].getblockcount() | ||||
block_time = self.nodes[0].getblockheader(tip)["time"] + 1 | block_time = self.nodes[0].getblockheader(tip)["time"] + 1 | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |