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
commitment, revelation, errmsg = self.make_commitment()
if not commitment:
self.taker_info_callback("ABORT", errmsg)
utxo_pairs, to, ts = revelation
if len(to) == 0:
#If any utxos are too new, then we can continue retrying
#until they get old enough; otherwise, we have to abort
#(TODO, it's possible for user to dynamically add more coins,
#consider if this option means we should stay alive).
self.taker_info_callback("ABORT", errmsg)
self.on_finished_callback(False)
else:
self.taker_info_callback("INFO", errmsg)
return (False,)
else:
self.taker_info_callback("INFO", errmsg)

12
scripts/joinmarket-qt.py

@ -739,14 +739,14 @@ class SpendTab(QWidget):
def takerInfo(self):
if self.taker_info_type == "info":
w.statusBar().showMessage(self.taker_infomsg)
elif self.taker_info_type == "warn":
#cannot use dialogs that interrupt gui thread here
if len(self.taker_infomsg) > 200:
JMQtMessageBox(self, "Details:", mbtype=self.taker_info_type,
detailed_text=self.taker_infomsg)
log.info("INFO: " + self.taker_infomsg)
else:
JMQtMessageBox(self, self.taker_infomsg,
mbtype=self.taker_info_type)
w.statusBar().showMessage(self.taker_infomsg)
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.
self.abortTransactions()
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)
else:
if detailed_text:
assert mbtype == 'warn'
assert mbtype == 'info'
class JMQtDMessageBox(QMessageBox):
def __init__(self):
@ -149,7 +149,7 @@ def JMQtMessageBox(obj, msg, mbtype='info', title='', detailed_text= None):
return result
b = JMQtDMessageBox()
b.setIcon(QMessageBox.Warning)
b.setIcon(QMessageBox.Information)
b.setWindowTitle(title)
b.setText(msg)
b.setDetailedText(detailed_text)

Loading…
Cancel
Save