From 8d0c03caff5879edb0c038d33602fc3721109f32 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sat, 27 Jun 2020 16:32:46 +0200 Subject: [PATCH] synchronizer: enforce that unconfirmed txs must have fee information related: #6289 --- electrum/synchronizer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electrum/synchronizer.py b/electrum/synchronizer.py index e922ebc3e..86018c798 100644 --- a/electrum/synchronizer.py +++ b/electrum/synchronizer.py @@ -174,6 +174,9 @@ class Synchronizer(SynchronizerBase): hashes = set(map(lambda item: item['tx_hash'], result)) hist = list(map(lambda item: (item['tx_hash'], item['height']), result)) # tx_fees + for item in result: + if item['height'] in (-1, 0) and 'fee' not in item: + raise Exception("server response to get_history contains unconfirmed tx without fee") tx_fees = [(item['tx_hash'], item.get('fee')) for item in result] tx_fees = dict(filter(lambda x:x[1] is not None, tx_fees)) # Check that txids are unique