electrum-personal-server

Maximally lightweight electrum server for a single user
git clone https://git.parazyd.org/electrum-personal-server
Log | Files | Refs | README

commit 5fd8f86b792a14aefb891366ee15390a0c5fc70f
parent a66f5288d82aab16d45c0d85578ede1c1a09b4b3
Author: chris-belcher <chris-belcher@users.noreply.github.com>
Date:   Tue,  3 Jul 2018 19:03:16 +0100

Make the address status of a empty address be None

Fixes an issue of not following the protocol of Electrum 3.2

Should solve issue #35

Diffstat:
Melectrumpersonalserver/hashes.py | 2++
Melectrumpersonalserver/transactionmonitor.py | 4++--
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/electrumpersonalserver/hashes.py b/electrumpersonalserver/hashes.py @@ -34,6 +34,8 @@ def script_to_scripthash(script): def get_status_electrum(h): if not h: return None + if len(h) == 0: + return None status = '' for tx_hash, height in h: status += tx_hash + ':%d:' % height diff --git a/electrumpersonalserver/transactionmonitor.py b/electrumpersonalserver/transactionmonitor.py @@ -60,8 +60,8 @@ class TransactionMonitor(object): self.reorganizable_txes = None def get_electrum_history_hash(self, scrhash): - return hashes.get_status_electrum( ((h["tx_hash"], h["height"]) - for h in self.address_history[scrhash]["history"]) ) + return hashes.get_status_electrum( [(h["tx_hash"], h["height"]) + for h in self.address_history[scrhash]["history"]] ) def get_electrum_history(self, scrhash): if scrhash in self.address_history: