mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
payjoin: exclude 0-conf inputs from receiver candidates (#3389)
This commit is contained in:
@@ -551,8 +551,8 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
|
||||
return tx;
|
||||
}
|
||||
|
||||
List<UtxoWithPrivateKey> getUtxoWithPrivateKeys() => unspentCoins
|
||||
.where((e) => (e.isSending && !e.isFrozen))
|
||||
List<UtxoWithPrivateKey> getUtxoWithPrivateKeys({bool confirmedOnly = false}) => unspentCoins
|
||||
.where((e) => e.isSending && !e.isFrozen && (!confirmedOnly || (e.confirmations ?? 0) > 0))
|
||||
.map((unspent) => UtxoWithPrivateKey.fromUnspent(unspent, this))
|
||||
.toList();
|
||||
|
||||
|
||||
@@ -297,10 +297,10 @@ class PayjoinManager {
|
||||
break;
|
||||
|
||||
case PayjoinReceiverRequestTypes.getCandidateInputs:
|
||||
utxos = _wallet.getUtxoWithPrivateKeys();
|
||||
utxos = _wallet.getUtxoWithPrivateKeys(confirmedOnly: true);
|
||||
if (utxos.isEmpty) {
|
||||
await _wallet.updateAllUnspents();
|
||||
utxos = _wallet.getUtxoWithPrivateKeys();
|
||||
utxos = _wallet.getUtxoWithPrivateKeys(confirmedOnly: true);
|
||||
}
|
||||
mainToIsolateSendPort?.send({
|
||||
'requestId': message['requestId'],
|
||||
|
||||
Reference in New Issue
Block a user