Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_csv_activation.py
Show First 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | def create_test_block_spend_utxos(self, node, txs, version=536870912): | ||||
block.rehash() | block.rehash() | ||||
block.solve() | block.solve() | ||||
return block | return block | ||||
def send_blocks(self, blocks, success=True): | def send_blocks(self, blocks, success=True): | ||||
"""Sends blocks to test node. Syncs and verifies that tip has advanced to most recent block. | """Sends blocks to test node. Syncs and verifies that tip has advanced to most recent block. | ||||
Call with success = False if the tip shouldn't advance to the most recent block.""" | Call with success = False if the tip shouldn't advance to the most recent block.""" | ||||
self.nodes[0].p2p.send_blocks_and_test( | self.helper_peer.send_blocks_and_test( | ||||
blocks, self.nodes[0], success=success) | blocks, self.nodes[0], success=success) | ||||
def run_test(self): | def run_test(self): | ||||
self.nodes[0].add_p2p_connection(P2PDataStore()) | self.helper_peer = self.nodes[0].add_p2p_connection(P2PDataStore()) | ||||
self.log.info("Generate blocks in the past for coinbase outputs.") | self.log.info("Generate blocks in the past for coinbase outputs.") | ||||
# Enough to build up to 1000 blocks 10 minutes apart without worrying | # Enough to build up to 1000 blocks 10 minutes apart without worrying | ||||
# about getting into the future | # about getting into the future | ||||
long_past_time = int(time.time()) - 600 * 1000 | long_past_time = int(time.time()) - 600 * 1000 | ||||
# Enough so that the generated blocks will still all be before | # Enough so that the generated blocks will still all be before | ||||
# long_past_time | # long_past_time | ||||
self.nodes[0].setmocktime(long_past_time - 100) | self.nodes[0].setmocktime(long_past_time - 100) | ||||
▲ Show 20 Lines • Show All 437 Lines • Show Last 20 Lines |