diff --git a/scripts/joinmarket-qt.py b/scripts/joinmarket-qt.py index 6a36761..35ae60a 100644 --- a/scripts/joinmarket-qt.py +++ b/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 - # there will be no makers for such amount. - if (makercount != 0 and btc_amount_str != '0' and - not checkAmount(self, btc_amount_str)): - return + if makercount != 0: + # for coinjoin sends no point to send below dust threshold, + # there will be no makers for such amount. + 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: diff --git a/scripts/sendpayment.py b/scripts/sendpayment.py index e520ad3..1433d9b 100644 --- a/scripts/sendpayment.py +++ b/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: