|
|
@ -77,8 +77,7 @@ class Agora(object):
|
|
|
|
current_trades = []
|
|
|
|
current_trades = []
|
|
|
|
for contact_id, contact in dash.items():
|
|
|
|
for contact_id, contact in dash.items():
|
|
|
|
reference = self.tx.tx_to_ref(contact_id)
|
|
|
|
reference = self.tx.tx_to_ref(contact_id)
|
|
|
|
if not reference:
|
|
|
|
if reference:
|
|
|
|
reference = "not_set"
|
|
|
|
|
|
|
|
current_trades.append(reference)
|
|
|
|
current_trades.append(reference)
|
|
|
|
buyer = contact["data"]["buyer"]["username"]
|
|
|
|
buyer = contact["data"]["buyer"]["username"]
|
|
|
|
amount = contact["data"]["amount"]
|
|
|
|
amount = contact["data"]["amount"]
|
|
|
@ -87,9 +86,11 @@ class Agora(object):
|
|
|
|
if not contact["data"]["is_selling"]:
|
|
|
|
if not contact["data"]["is_selling"]:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
if reference not in self.last_dash:
|
|
|
|
if reference not in self.last_dash:
|
|
|
|
self.tx.new_trade(contact_id, buyer, currency, amount, amount_xmr)
|
|
|
|
reference = self.tx.new_trade(contact_id, buyer, currency, amount, amount_xmr)
|
|
|
|
|
|
|
|
if reference:
|
|
|
|
|
|
|
|
if reference not in current_trades:
|
|
|
|
|
|
|
|
current_trades.append(reference)
|
|
|
|
if send_irc:
|
|
|
|
if send_irc:
|
|
|
|
|
|
|
|
|
|
|
|
self.irc.client.msg(self.irc.client.channel, f"AUTO {reference}: {buyer} {amount}{currency} {amount_xmr}XMR")
|
|
|
|
self.irc.client.msg(self.irc.client.channel, f"AUTO {reference}: {buyer} {amount}{currency} {amount_xmr}XMR")
|
|
|
|
|
|
|
|
|
|
|
|
dash_tmp.append(f"{reference}: {buyer} {amount}{currency} {amount_xmr}XMR")
|
|
|
|
dash_tmp.append(f"{reference}: {buyer} {amount}{currency} {amount_xmr}XMR")
|
|
|
@ -99,6 +100,8 @@ class Agora(object):
|
|
|
|
for ref in list(self.last_dash): # We're removing from the list on the fly
|
|
|
|
for ref in list(self.last_dash): # We're removing from the list on the fly
|
|
|
|
if ref not in current_trades:
|
|
|
|
if ref not in current_trades:
|
|
|
|
self.last_dash.remove(ref)
|
|
|
|
self.last_dash.remove(ref)
|
|
|
|
|
|
|
|
if reference and reference not in current_trades:
|
|
|
|
|
|
|
|
current_trades.append(reference)
|
|
|
|
self.tx.cleanup(current_trades)
|
|
|
|
self.tx.cleanup(current_trades)
|
|
|
|
return dash_tmp
|
|
|
|
return dash_tmp
|
|
|
|
|
|
|
|
|
|
|
|