mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-23 22:42:34 +02:00
wallet: unconfirmed ancestors and descendants are always truc
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <node/types.h>
|
||||
#include <numeric>
|
||||
#include <policy/policy.h>
|
||||
#include <policy/truc_policy.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <primitives/transaction_identifier.h>
|
||||
#include <script/script.h>
|
||||
@@ -386,6 +387,14 @@ CoinsResult AvailableCoins(const CWallet& wallet,
|
||||
safeTx = false;
|
||||
}
|
||||
|
||||
if (nDepth == 0 && params.check_version_trucness) {
|
||||
if (coinControl->m_version == TRUC_VERSION) {
|
||||
if (wtx.tx->version != TRUC_VERSION) continue;
|
||||
} else {
|
||||
if (wtx.tx->version == TRUC_VERSION) continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (only_safe && !safeTx) {
|
||||
continue;
|
||||
}
|
||||
@@ -484,6 +493,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
|
||||
CoinsResult AvailableCoinsListUnspent(const CWallet& wallet, const CCoinControl* coinControl, CoinFilterParams params)
|
||||
{
|
||||
params.only_spendable = false;
|
||||
params.check_version_trucness = false;
|
||||
return AvailableCoins(wallet, coinControl, /*feerate=*/ std::nullopt, params);
|
||||
}
|
||||
|
||||
|
@@ -83,6 +83,9 @@ struct CoinFilterParams {
|
||||
bool include_immature_coinbase{false};
|
||||
// By default, skip locked UTXOs
|
||||
bool skip_locked{true};
|
||||
// When true, filter unconfirmed coins by whether their
|
||||
// version's TRUCness matches what is set by CCoinControl.
|
||||
bool check_version_trucness{true};
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user