mirror of
https://github.com/JoinMarket-Org/joinmarket-clientserver.git
synced 2026-08-15 12:50:57 +02:00
Require confirmed coins to receive payjoin
This commit is contained in:
parent
8c57852b2a
commit
0d21b927c5
3 changed files with 6 additions and 5 deletions
|
|
@ -394,7 +394,7 @@ class JMPayjoinManager(object):
|
|||
try:
|
||||
my_utxos = self.wallet_service.select_utxos(
|
||||
self.mixdepth, jm_single().DUST_THRESHOLD,
|
||||
select_fn=select_one_utxo)
|
||||
select_fn=select_one_utxo, minconfs=1)
|
||||
except Exception as e:
|
||||
log.error("Failed to select coins, exception: " + repr(e))
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -1566,9 +1566,10 @@ class JMMainWindow(QMainWindow):
|
|||
"Wallet does not have mixdepth " + str(mixdepth),
|
||||
mbtype='crit', title="Error")
|
||||
return False
|
||||
if self.wallet_service.get_balance_by_mixdepth()[mixdepth] == 0:
|
||||
if self.wallet_service.get_balance_by_mixdepth(minconfs=1)[mixdepth] == 0:
|
||||
JMQtMessageBox(self, "Mixdepth " + str(mixdepth) + \
|
||||
" has no coins.", mbtype='crit', title="Error")
|
||||
" has no confirmed coins.",
|
||||
mbtype='crit', title="Error")
|
||||
return False
|
||||
self.backend_receiver = JMBIP78ReceiverManager(self.wallet_service,
|
||||
mixdepth, amount, 80, self.receiver_bip78_dialog.info_update,
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ def receive_payjoin_main():
|
|||
wallet_service.startService()
|
||||
# having enforced wallet sync, we can check if we have coins
|
||||
# to do payjoin in the mixdepth
|
||||
if wallet_service.get_balance_by_mixdepth()[options.mixdepth] == 0:
|
||||
if wallet_service.get_balance_by_mixdepth(minconfs=1)[options.mixdepth] == 0:
|
||||
jlog.error("Cannot do payjoin from mixdepth " + str(
|
||||
options.mixdepth) + ", no coins. Shutting down.")
|
||||
options.mixdepth) + ", no confirmed coins. Shutting down.")
|
||||
sys.exit(EXIT_ARGERROR)
|
||||
receiver_manager = JMBIP78ReceiverManager(wallet_service, options.mixdepth,
|
||||
bip78_amount, options.hsport)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue