Browse Source

Abort single join early if maker count below minimum_makers

master
Kristaps Kaupe 6 years ago
parent
commit
5976db7d4f
No known key found for this signature in database
GPG Key ID: D47B1B4232B55437
  1. 13
      scripts/joinmarket-qt.py
  2. 8
      scripts/sendpayment.py

13
scripts/joinmarket-qt.py

@ -629,11 +629,20 @@ class SpendTab(QWidget):
makercount = int(self.widgets[1][1].text())
mixdepth = int(self.widgets[2][1].text())
btc_amount_str = self.widgets[3][1].text()
# for coinjoin sends no point to send below dust threshold, likely
if makercount != 0:
# for coinjoin sends no point to send below dust threshold,
# there will be no makers for such amount.
if (makercount != 0 and btc_amount_str != '0' and
if (btc_amount_str != '0' and
not checkAmount(self, btc_amount_str)):
return
if makercount < jm_single().config.getint(
"POLICY", "minimum_makers"):
JMQtMessageBox(self, "Number of counterparties (" + str(
makercount) + ") below minimum_makers (" + str(
jm_single().config.getint("POLICY", "minimum_makers")) +
") in configuration.",
title="Error", mbtype="warn")
return
amount = btc.amount_to_sat(btc_amount_str)
if makercount == 0:
try:

8
scripts/sendpayment.py

@ -77,6 +77,14 @@ def main():
' is below dust threshold ' +
btc.amount_to_str(DUST_THRESHOLD) + '.', "error")
sys.exit(EXIT_ARGERROR)
if (options.makercount != 0 and
options.makercount < jm_single().config.getint(
"POLICY", "minimum_makers")):
jmprint('ERROR: Maker count ' + str(options.makercount) +
' below minimum_makers (' + str(jm_single().config.getint(
"POLICY", "minimum_makers")) + ') in joinmarket.cfg.',
"error")
sys.exit(EXIT_ARGERROR)
schedule = [[options.mixdepth, amount, options.makercount,
destaddr, 0.0, NO_ROUNDING, 0]]
else:

Loading…
Cancel
Save