Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_resendwallettransactions.py
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.log.info("Create a block") | self.log.info("Create a block") | ||||
# Create and submit a block without the transaction. | # Create and submit a block without the transaction. | ||||
# Transactions are only rebroadcast if there has been a block at least five minutes | # Transactions are only rebroadcast if there has been a block at least five minutes | ||||
# after the last time we tried to broadcast. Use mocktime and give an | # after the last time we tried to broadcast. Use mocktime and give an | ||||
# extra minute to be sure. | # extra minute to be sure. | ||||
block_time = int(time.time()) + 6 * 60 | block_time = int(time.time()) + 6 * 60 | ||||
node.setmocktime(block_time) | node.setmocktime(block_time) | ||||
block = create_block(int(node.getbestblockhash(), 16), create_coinbase( | block = create_block(int(node.getbestblockhash(), 16), create_coinbase( | ||||
node.getblockchaininfo()['blocks']), block_time) | node.getblockcount() + 1), block_time) | ||||
block.nVersion = 3 | |||||
block.rehash() | block.rehash() | ||||
block.solve() | block.solve() | ||||
node.submitblock(ToHex(block)) | node.submitblock(ToHex(block)) | ||||
# Transaction should not be rebroadcast | # Transaction should not be rebroadcast | ||||
node.p2ps[1].sync_with_ping() | node.p2ps[1].sync_with_ping() | ||||
assert_equal(node.p2ps[1].tx_invs_received[txid], 0) | assert_equal(node.p2ps[1].tx_invs_received[txid], 0) | ||||
Show All 11 Lines |