Browse Source

Fix ob-watcher script after dust threshold change

Before this commit, the ob-watcher.py script errored
in trying to read offers because the variable
dust_threshold of the OrderbookWatch class was not
initialized; this was because this variable is now
set by the client in the AMP message JMInit; but
ob-watcher is a script that runs without any such
client. Since the script has access to the global
configuration from the jmclient package anyway, the
fix is just to add that into the ObBasic class
constructor.
master
Adam Gibson 4 years ago
parent
commit
7eaf368dd7
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 4
      scripts/obwatch/ob-watcher.py

4
scripts/obwatch/ob-watcher.py

@ -721,6 +721,10 @@ class ObBasic(OrderbookWatch):
def __init__(self, msgchan, hostport):
self.hostport = hostport
self.set_msgchan(msgchan)
# in client-server, this is passed by client
# in INIT message. Here, we have no Joinmarket client,
# but we have access to the client config in this script:
self.dust_threshold = jm_single().DUST_THRESHOLD
def on_welcome(self):
"""TODO: It will probably be a bit

Loading…
Cancel
Save