aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-07-28 16:57:58 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2022-11-16 12:14:42 -0300
commit212ccdf2c2b70d973b18ae78f0158ec5f0c3bbb4 (patch)
tree1653b5fd7a05ad942547000f5ac34b00d5d78ddb
parentf0c646f026e652082e798800136dc06c734fdab6 (diff)
wallet: AvailableCoins, add arg to include/skip locked coins
-rw-r--r--src/wallet/spend.cpp2
-rw-r--r--src/wallet/spend.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp
index 8c0d56a1cb..62c7a90e24 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 ba2c6638c8..94bf2902c1 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};
};
/**