Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_resendwallettransactions.py
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
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.getblockcount() + 1), block_time) | node.getblockcount() + 1), block_time) | ||||
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.syncwithvalidationinterfacequeue() | |||||
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) | ||||
self.log.info("Transaction should be rebroadcast after 30 minutes") | self.log.info("Transaction should be rebroadcast after 30 minutes") | ||||
# Use mocktime and give an extra 5 minutes to be sure. | # Use mocktime and give an extra 5 minutes to be sure. | ||||
rebroadcast_time = int(time.time()) + 41 * 60 | rebroadcast_time = int(time.time()) + 41 * 60 | ||||
node.setmocktime(rebroadcast_time) | node.setmocktime(rebroadcast_time) | ||||
wait_until( | wait_until( | ||||
lambda: node.p2ps[1].tx_invs_received[txid] >= 1, | lambda: node.p2ps[1].tx_invs_received[txid] >= 1, | ||||
lock=mininode_lock) | lock=mininode_lock) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
ResendWalletTransactionsTest().main() | ResendWalletTransactionsTest().main() |