undo verification when removing txn
This commit is contained in:
parent
0d758a650d
commit
008bffcea7
|
@ -758,6 +758,7 @@ class Abstract_Wallet(PrintError):
|
||||||
is_mine = any([self.is_mine(txin['address']) for txin in tx.inputs()])
|
is_mine = any([self.is_mine(txin['address']) for txin in tx.inputs()])
|
||||||
# do not save if tx is local and not mine
|
# do not save if tx is local and not mine
|
||||||
if tx_height == TX_HEIGHT_LOCAL and not is_mine:
|
if tx_height == TX_HEIGHT_LOCAL and not is_mine:
|
||||||
|
# FIXME the test here should be for "not all is_mine"; cannot detect conflict in some cases
|
||||||
return False
|
return False
|
||||||
# raise exception if unrelated to wallet
|
# raise exception if unrelated to wallet
|
||||||
is_for_me = any([self.is_mine(self.get_txout_address(txo)) for txo in tx.outputs()])
|
is_for_me = any([self.is_mine(self.get_txout_address(txo)) for txo in tx.outputs()])
|
||||||
|
@ -874,12 +875,13 @@ class Abstract_Wallet(PrintError):
|
||||||
old_hist = self.get_address_history(addr)
|
old_hist = self.get_address_history(addr)
|
||||||
for tx_hash, height in old_hist:
|
for tx_hash, height in old_hist:
|
||||||
if (tx_hash, height) not in hist:
|
if (tx_hash, height) not in hist:
|
||||||
# make tx local if is_mine, else remove it
|
# make tx local
|
||||||
if self.txi[tx_hash] != {}:
|
|
||||||
self.unverified_tx.pop(tx_hash, None)
|
self.unverified_tx.pop(tx_hash, None)
|
||||||
self.verified_tx.pop(tx_hash, None)
|
self.verified_tx.pop(tx_hash, None)
|
||||||
self.verifier.merkle_roots.pop(tx_hash, None)
|
self.verifier.merkle_roots.pop(tx_hash, None)
|
||||||
else:
|
# but remove completely if not is_mine
|
||||||
|
if self.txi[tx_hash] == {}:
|
||||||
|
# FIXME the test here should be for "not all is_mine"; cannot detect conflict in some cases
|
||||||
self.remove_transaction(tx_hash)
|
self.remove_transaction(tx_hash)
|
||||||
self.history[addr] = hist
|
self.history[addr] = hist
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue