tMerge pull request #118 from BobleChinois/NaiveImportCheck - 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 063662b9413ab1dfab5bd1a3f82c92a181f72692
parent 6de954ab7282817ee01ea447c84029421cef9c9b
Author: chris-belcher 
Date:   Wed, 19 Jun 2019 12:09:27 +0100

Merge pull request #118 from BobleChinois/NaiveImportCheck

check for first 3 addresses and last address
Diffstat:
  M electrumpersonalserver/server/comm… |       4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/electrumpersonalserver/server/common.py b/electrumpersonalserver/server/common.py
t@@ -546,7 +546,9 @@ def get_scriptpubkeys_to_monitor(rpc, config):
         first_addrs = [hashes.script_to_address(s, rpc) for s in first_spks]
         logger.info("\n" + config_mpk_key + " =>\n\t" + "\n\t".join(
             first_addrs))
-        if not set(first_addrs).issubset(imported_addresses):
+        last_spk = wal.get_scriptpubkeys(0, int(config.get("bitcoin-rpc", "initial_import_count")) - 1, 1) 
+        last_addr = [hashes.script_to_address(last_spk[0], rpc)] 
+        if not set(first_addrs + last_addr).issubset(imported_addresses):
             import_needed = True
             wallets_imported += 1
             for change in [0, 1]: