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 247e63061ef4686fa54660883e35931276874cc1
parent 1751fb724a9f38c47ec663e4b9f9dc59542b916c
Author: chris-belcher <chris-belcher@users.noreply.github.com>
Date:   Wed, 23 May 2018 17:17:18 +0100

Add log statements about the time to obtain addresses

Diffstat:
MREADME.md | 3++-
Melectrumpersonalserver/transactionmonitor.py | 6+++---
Mserver.py | 4++++
3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -56,7 +56,8 @@ Enter the directory and rename the file `config.cfg_sample` to `config.cfg`. * Edit the file `config.cfg` to configure everything about the server. Add your wallet master public keys or watch-only addresses to the `[master-public-keys]` and `[watch-only-addresses]` sections. Master public keys for an Electrum wallet -can be found in the Electrum client menu `Wallet` -> `Information`. +(which start with xpub/ypub/zpub) can be found in the Electrum client menu +`Wallet` -> `Information`. * Run `./server.py` on Linux or double-click `run-server.bat` on Windows. The first time the server is run it will import all configured addresses as diff --git a/electrumpersonalserver/transactionmonitor.py b/electrumpersonalserver/transactionmonitor.py @@ -81,7 +81,7 @@ class TransactionMonitor(object): def build_address_history(self, monitored_scriptpubkeys): self.log("Building history with " + str(len(monitored_scriptpubkeys)) + - " addresses") + " addresses . . .") st = time.time() address_history = {} for spk in monitored_scriptpubkeys: @@ -173,8 +173,8 @@ class TransactionMonitor(object): et = time.time() self.debug("address_history =\n" + pprint.pformat(address_history)) - self.log("Found " + str(count) + " txes. History built in " + - str(et - st) + "sec") + self.log("Found " + str(count) + " txes. History built in " + + str(et - st) + "sec") self.address_history = address_history self.unconfirmed_txes = unconfirmed_txes return True diff --git a/server.py b/server.py @@ -354,6 +354,8 @@ def run_electrum_server(rpc, txmonitor, hostport, ip_whitelist, time.sleep(0.2) def get_scriptpubkeys_to_monitor(rpc, config): + log("Obtaining bitcoin addresses to monitor . . .") + st = time.time() imported_addresses = set(rpc.call("getaddressesbyaccount", [transactionmonitor.ADDRESSES_LABEL])) @@ -423,6 +425,8 @@ def get_scriptpubkeys_to_monitor(rpc, config): spks_to_monitor.extend([hashes.address_to_script(addr, rpc) for addr in watch_only_addresses]) + et = time.time() + log("Obtained list of addresses to monitor in " + str(et - st) + "sec") return False, spks_to_monitor, deterministic_wallets def obtain_rpc_username_password(datadir):