Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_resendwallettransactions.py
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# ensure enough time has passed for rebroadcast attempt to occur | # ensure enough time has passed for rebroadcast attempt to occur | ||||
time.sleep(2) | time.sleep(2) | ||||
assert_equal(txid in node.p2ps[1].get_invs(), False) | assert_equal(txid in node.p2ps[1].get_invs(), False) | ||||
self.log.info("Bump time & check that transaction is rebroadcast") | self.log.info("Bump time & check that transaction is rebroadcast") | ||||
# Transaction should be rebroadcast approximately 24 hours in the future, | # Transaction should be rebroadcast approximately 24 hours in the future, | ||||
# but can range from 12-36. So bump 36 hours to be sure. | # but can range from 12-36. So bump 36 hours to be sure. | ||||
node.setmocktime(now + 36 * 60 * 60) | node.setmocktime(now + 36 * 60 * 60) | ||||
# Tell scheduler to call MaybeResendWalletTxn now. | |||||
node.mockscheduler(1) | |||||
# Give some time for trickle to occur | |||||
node.setmocktime(now + 36 * 60 * 60 + 600) | |||||
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() |