electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit ecefa47b401e8c82a6b6b60549a8313b50c66fa7
parent 4f2aa53a7657fb90bcdd74b6e1fa48c545fcadd7
Author: SomberNight <somber.night@protonmail.com>
Date:   Fri, 12 Apr 2019 20:29:05 +0200

verifier: trivial clean-up

Diffstat:
Melectrum/verifier.py | 11+++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/electrum/verifier.py b/electrum/verifier.py @@ -102,8 +102,7 @@ class SPV(NetworkJobOnDefaultServer): raise self.print_error('tx {} not at height {}'.format(tx_hash, tx_height)) self.wallet.remove_unverified_tx(tx_hash, tx_height) - try: self.requested_merkle.remove(tx_hash) - except KeyError: pass + self.requested_merkle.discard(tx_hash) return # Verify the hash of the server-provided merkle branch to a # transaction matches the merkle root of its block @@ -126,8 +125,7 @@ class SPV(NetworkJobOnDefaultServer): raise GracefulDisconnect(e) # we passed all the tests self.merkle_roots[tx_hash] = header.get('merkle_root') - try: self.requested_merkle.remove(tx_hash) - except KeyError: pass + self.requested_merkle.discard(tx_hash) self.print_error("verified %s" % tx_hash) header_hash = hash_header(header) tx_info = TxMinedInfo(height=tx_height, @@ -181,10 +179,7 @@ class SPV(NetworkJobOnDefaultServer): def remove_spv_proof_for_tx(self, tx_hash): self.merkle_roots.pop(tx_hash, None) - try: - self.requested_merkle.remove(tx_hash) - except KeyError: - pass + self.requested_merkle.discard(tx_hash) def is_up_to_date(self): return not self.requested_merkle