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 f506a9ebd4a0e9dbfafd72d81228ae149fb51be8
parent 6a7c621aa1d31df3716a10865125a28ed79c976e
Author: chris-belcher <chris-belcher@users.noreply.github.com>
Date:   Thu, 25 Apr 2019 15:00:46 +0100

Refuse to start if no mpks or addrs are configured

Lots of newbs dont configure any master public keys or
addresses at all, this error message will be helpful to
them.

Diffstat:
Melectrumpersonalserver/server/common.py | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/electrumpersonalserver/server/common.py b/electrumpersonalserver/server/common.py @@ -523,6 +523,12 @@ def get_scriptpubkeys_to_monitor(rpc, config): watch_only_addresses_to_import = (watch_only_addresses - imported_addresses) + if len(deterministic_wallets) == 0 and len(watch_only_addresses) == 0: + logger.error("No master public keys or watch-only addresses have " + + "been configured at all. Exiting..") + #import = true and no addresses means exit + return (True, [], None) + #if addresses need to be imported then return them if import_needed: addresses_to_import = [hashes.script_to_address(spk, rpc) @@ -693,6 +699,9 @@ def main(): import_needed, relevant_spks_addrs, deterministic_wallets = \ get_scriptpubkeys_to_monitor(rpc, config) if import_needed: + if len(relevant_spks_addrs) == 0: + #import = true and no addresses means exit + return transactionmonitor.import_addresses(rpc, relevant_spks_addrs) logger.info("Done.\nIf recovering a wallet which already has existing" + " transactions, then\nrun the rescan script. If you're confident" +