From 7eaf368dd7f72d37459030658546388a3893cef5 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 7 Sep 2021 09:19:50 +0100 Subject: [PATCH] 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. --- scripts/obwatch/ob-watcher.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/obwatch/ob-watcher.py b/scripts/obwatch/ob-watcher.py index 3079e94..adf5cc2 100755 --- a/scripts/obwatch/ob-watcher.py +++ b/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