Browse Source

Qt tumble no longer aborts or blocks on too-new commitments

master
Adam Gibson 9 years ago
parent
commit
537ae872be
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 4
      jmclient/jmclient/taker.py
  2. 12
      scripts/joinmarket-qt.py
  3. 4
      scripts/qtsupport.py

4
jmclient/jmclient/taker.py

@ -155,14 +155,16 @@ class Taker(object):
#Prepare a commitment #Prepare a commitment
commitment, revelation, errmsg = self.make_commitment() commitment, revelation, errmsg = self.make_commitment()
if not commitment: if not commitment:
self.taker_info_callback("ABORT", errmsg)
utxo_pairs, to, ts = revelation utxo_pairs, to, ts = revelation
if len(to) == 0: if len(to) == 0:
#If any utxos are too new, then we can continue retrying #If any utxos are too new, then we can continue retrying
#until they get old enough; otherwise, we have to abort #until they get old enough; otherwise, we have to abort
#(TODO, it's possible for user to dynamically add more coins, #(TODO, it's possible for user to dynamically add more coins,
#consider if this option means we should stay alive). #consider if this option means we should stay alive).
self.taker_info_callback("ABORT", errmsg)
self.on_finished_callback(False) self.on_finished_callback(False)
else:
self.taker_info_callback("INFO", errmsg)
return (False,) return (False,)
else: else:
self.taker_info_callback("INFO", errmsg) self.taker_info_callback("INFO", errmsg)

12
scripts/joinmarket-qt.py

@ -739,14 +739,14 @@ class SpendTab(QWidget):
def takerInfo(self): def takerInfo(self):
if self.taker_info_type == "info": if self.taker_info_type == "info":
w.statusBar().showMessage(self.taker_infomsg) #cannot use dialogs that interrupt gui thread here
elif self.taker_info_type == "warn":
if len(self.taker_infomsg) > 200: if len(self.taker_infomsg) > 200:
JMQtMessageBox(self, "Details:", mbtype=self.taker_info_type, log.info("INFO: " + self.taker_infomsg)
detailed_text=self.taker_infomsg)
else: else:
JMQtMessageBox(self, self.taker_infomsg, w.statusBar().showMessage(self.taker_infomsg)
mbtype=self.taker_info_type) elif self.taker_info_type == "warn":
JMQtMessageBox(self, self.taker_infomsg,
mbtype=self.taker_info_type)
#Abort signal explicitly means this transaction will not continue. #Abort signal explicitly means this transaction will not continue.
self.abortTransactions() self.abortTransactions()
self.taker_info_response = True self.taker_info_response = True

4
scripts/qtsupport.py

@ -124,7 +124,7 @@ def JMQtMessageBox(obj, msg, mbtype='info', title='', detailed_text= None):
QMessageBox.No) QMessageBox.No)
else: else:
if detailed_text: if detailed_text:
assert mbtype == 'warn' assert mbtype == 'info'
class JMQtDMessageBox(QMessageBox): class JMQtDMessageBox(QMessageBox):
def __init__(self): def __init__(self):
@ -149,7 +149,7 @@ def JMQtMessageBox(obj, msg, mbtype='info', title='', detailed_text= None):
return result return result
b = JMQtDMessageBox() b = JMQtDMessageBox()
b.setIcon(QMessageBox.Warning) b.setIcon(QMessageBox.Information)
b.setWindowTitle(title) b.setWindowTitle(title)
b.setText(msg) b.setText(msg)
b.setDetailedText(detailed_text) b.setDetailedText(detailed_text)

Loading…
Cancel
Save