From 2dc90594b845a3ba09dc5d3155d310b9da6b0ac8 Mon Sep 17 00:00:00 2001 From: nuka Date: Mon, 8 Feb 2016 00:35:29 +0000 Subject: [PATCH] create new orders for each new identity --- joinmarket/irc.py | 2 +- joinmarket/maker.py | 5 ++++- joinmarket/message_channel.py | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/joinmarket/irc.py b/joinmarket/irc.py index 9d2a523d..574279ac 100644 --- a/joinmarket/irc.py +++ b/joinmarket/irc.py @@ -588,7 +588,7 @@ def __init__(self, self.reconnect_delay = 30 self.newnyms = False try: - self.reconnect_delaty = int(config.get("MESSAGING", "reconnect_delay")) + self.reconnect_delay = int(config.get("MESSAGING", "reconnect_delay")) self.newnyms = (config.get("MESSAGING", "newnym").lower() == 'true') self.tor_host = config.get("MESSAGING", "tor_host") self.tor_port = int(config.get("MESSAGING", "tor_port")) diff --git a/joinmarket/maker.py b/joinmarket/maker.py index d90e70bf..d3bfc842 100644 --- a/joinmarket/maker.py +++ b/joinmarket/maker.py @@ -213,7 +213,8 @@ def __init__(self, msgchan, wallet): self.active_orders = {} self.wallet = wallet self.nextoid = -1 - self.orderlist = self.create_my_orders() + if not self.msgchan.newnyms: + self.orderlist = self.create_my_orders() self.wallet_unspent_lock = threading.Lock() def get_crypto_box_from_nick(self, nick): @@ -265,6 +266,8 @@ def on_push_tx(self, nick, txhex): self.msgchan.send_error(nick, 'Unable to push tx') def on_welcome(self): + if self.msgchan.newnyms: + self.orderlist = self.create_my_orders() self.msgchan.announce_orders(self.orderlist) self.active_orders = {} diff --git a/joinmarket/message_channel.py b/joinmarket/message_channel.py index 0a6d4b2d..8f220ab0 100644 --- a/joinmarket/message_channel.py +++ b/joinmarket/message_channel.py @@ -29,6 +29,8 @@ def __init__(self): self.on_seen_auth = None self.on_seen_tx = None self.on_push_tx = None + # chan-specific attributes + self.newnyms = False def run(self): pass