From ace9996d8e0ffa3b885ebca83b272f3a0a3f8823 Mon Sep 17 00:00:00 2001 From: Tim Akinbo <41004+takinbo@users.noreply.github.com> Date: Tue, 7 Jun 2022 06:36:17 +0000 Subject: [PATCH] ob-watcher: tackle stale orders by first removing all of them when checking for timed-out counterparties (or refreshing the orderbook), stale entries are preserved because those peers disconnected prematurely. This fix prevents that issue by first removing all entries before requesting for the orderbook. --- scripts/obwatch/ob-watcher.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/obwatch/ob-watcher.py b/scripts/obwatch/ob-watcher.py index a156ccf..7938fe0 100755 --- a/scripts/obwatch/ob-watcher.py +++ b/scripts/obwatch/ob-watcher.py @@ -684,6 +684,9 @@ class OrderbookPageRequestHeader(http.server.SimpleHTTPRequestHandler): if self.path not in pages: return if self.path == '/refreshorderbook': + with self.taker.dblock: + self.taker.db.execute("DELETE FROM orderbook;") + self.taker.db.execute("DELETE FROM fidelitybonds;") self.taker.msgchan.request_orderbook() time.sleep(5) self.path = '/' @@ -768,7 +771,6 @@ def on_privmsg(inst, nick, message): except: pass - def get_dummy_nick(): """In Joinmarket-CS nick creation is negotiated between client and server/daemon so as to allow