From 212ccdf2c2b70d973b18ae78f0158ec5f0c3bbb4 Mon Sep 17 00:00:00 2001 From: furszy Date: Thu, 28 Jul 2022 16:57:58 -0300 Subject: [PATCH] wallet: AvailableCoins, add arg to include/skip locked coins --- src/wallet/spend.cpp | 2 +- src/wallet/spend.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index 8c0d56a1cb0..62c7a90e249 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -275,7 +275,7 @@ CoinsResult AvailableCoins(const CWallet& wallet, if (coinControl && coinControl->HasSelected() && coinControl->IsSelected(outpoint)) continue; - if (wallet.IsLockedCoin(outpoint)) + if (wallet.IsLockedCoin(outpoint) && params.skip_locked) continue; if (wallet.IsSpent(outpoint)) diff --git a/src/wallet/spend.h b/src/wallet/spend.h index ba2c6638c83..94bf2902c1f 100644 --- a/src/wallet/spend.h +++ b/src/wallet/spend.h @@ -68,6 +68,8 @@ struct CoinFilterParams { bool only_spendable{true}; // By default, do not include immature coinbase outputs bool include_immature_coinbase{false}; + // By default, skip locked UTXOs + bool skip_locked{true}; }; /**