trename command: notify - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 95393656aa1deb6c92d996aa0287b90cba5bc70e
DIR parent 3eca419ef3399c67240780f726835dbab22a85d7
HTML Author: ThomasV <thomasv@electrum.org>
Date: Tue, 1 Dec 2015 08:58:00 +0100
rename command: notify
Diffstat:
M RELEASE-NOTES | 2 ++
M lib/commands.py | 5 ++---
M lib/daemon.py | 4 ++--
3 files changed, 6 insertions(+), 5 deletions(-)
---
DIR diff --git a/RELEASE-NOTES b/RELEASE-NOTES
t@@ -1,5 +1,7 @@
# Release 2.6
* separation between plugins and GUIs
+ * the daemon supports jsonrpc commands
+ * new command: 'notify <address> <url>'
# Release 2.5.4
* increase MIN_RELAY_TX_FEE to avoid dust transactions
DIR diff --git a/lib/commands.py b/lib/commands.py
t@@ -601,7 +601,7 @@ class Commands:
self.wallet.remove_payment_request(k, self.config)
@command('n')
- def watchaddress(self, address, URL):
+ def notify(self, address, URL):
"""Watch an address. Everytime the address changes, a http POST is sent to the URL."""
def callback(x):
import urllib2
t@@ -614,8 +614,7 @@ class Commands:
except BaseException as e:
util.print_error(str(e))
self.network.send([('blockchain.address.subscribe', [address])], callback)
- return "ok"
-
+ return True
param_descriptions = {
'privkey': 'Private key. Type \'?\' to get a prompt.',
DIR diff --git a/lib/daemon.py b/lib/daemon.py
t@@ -75,13 +75,13 @@ class Daemon(util.DaemonThread):
self.server.register_function(getattr(self.cmd_runner, cmdname), cmdname)
self.server.register_function(self.run_cmdline, 'run_cmdline')
self.server.register_function(self.ping, 'ping')
- self.server.register_function(self.daemon, 'daemon')
+ self.server.register_function(self.run_daemon, 'daemon')
self.server.register_function(self.run_gui, 'gui')
def ping(self):
return True
- def daemon(self, config):
+ def run_daemon(self, config):
sub = config.get('subcommand')
assert sub in ['start', 'stop', 'status']
if sub == 'start':