Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_reorgsrestore.py
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
'wallet.bak')) | 'wallet.bak')) | ||||
shutil.copyfile( | shutil.copyfile( | ||||
os.path.join( | os.path.join( | ||||
self.nodes[0].datadir, | self.nodes[0].datadir, | ||||
'wallet.bak'), | 'wallet.bak'), | ||||
os.path.join( | os.path.join( | ||||
self.nodes[1].datadir, | self.nodes[1].datadir, | ||||
self.chain, | self.chain, | ||||
'wallet.dat')) | self.default_wallet_name, | ||||
self.wallet_data_filename)) | |||||
self.start_node(1) | self.start_node(1) | ||||
tx_after_reorg = self.nodes[1].gettransaction(txid) | tx_after_reorg = self.nodes[1].gettransaction(txid) | ||||
# Check that normal confirmed tx is confirmed again but with different | # Check that normal confirmed tx is confirmed again but with different | ||||
# blockhash | # blockhash | ||||
assert_equal(tx_after_reorg["confirmations"], 2) | assert_equal(tx_after_reorg["confirmations"], 2) | ||||
assert(tx_before_reorg["blockhash"] != tx_after_reorg["blockhash"]) | assert(tx_before_reorg["blockhash"] != tx_after_reorg["blockhash"]) | ||||
conflicted_after_reorg = self.nodes[1].gettransaction(conflicted_txid) | conflicted_after_reorg = self.nodes[1].gettransaction(conflicted_txid) | ||||
# Check that conflicted tx is confirmed again with blockhash different | # Check that conflicted tx is confirmed again with blockhash different | ||||
# than previously conflicting tx | # than previously conflicting tx | ||||
assert_equal(conflicted_after_reorg["confirmations"], 1) | assert_equal(conflicted_after_reorg["confirmations"], 1) | ||||
assert(conflicting["blockhash"] != conflicted_after_reorg["blockhash"]) | assert(conflicting["blockhash"] != conflicted_after_reorg["blockhash"]) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
ReorgsRestoreTest().main() | ReorgsRestoreTest().main() |