mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-24 12:51:39 +02:00
wallet: unconfirmed ancestors and descendants are always truc
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#include <node/types.h>
|
#include <node/types.h>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <policy/policy.h>
|
#include <policy/policy.h>
|
||||||
|
#include <policy/truc_policy.h>
|
||||||
#include <primitives/transaction.h>
|
#include <primitives/transaction.h>
|
||||||
#include <primitives/transaction_identifier.h>
|
#include <primitives/transaction_identifier.h>
|
||||||
#include <script/script.h>
|
#include <script/script.h>
|
||||||
@@ -386,6 +387,14 @@ CoinsResult AvailableCoins(const CWallet& wallet,
|
|||||||
safeTx = false;
|
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) {
|
if (only_safe && !safeTx) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -484,6 +493,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
|
|||||||
CoinsResult AvailableCoinsListUnspent(const CWallet& wallet, const CCoinControl* coinControl, CoinFilterParams params)
|
CoinsResult AvailableCoinsListUnspent(const CWallet& wallet, const CCoinControl* coinControl, CoinFilterParams params)
|
||||||
{
|
{
|
||||||
params.only_spendable = false;
|
params.only_spendable = false;
|
||||||
|
params.check_version_trucness = false;
|
||||||
return AvailableCoins(wallet, coinControl, /*feerate=*/ std::nullopt, params);
|
return AvailableCoins(wallet, coinControl, /*feerate=*/ std::nullopt, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -83,6 +83,9 @@ struct CoinFilterParams {
|
|||||||
bool include_immature_coinbase{false};
|
bool include_immature_coinbase{false};
|
||||||
// By default, skip locked UTXOs
|
// By default, skip locked UTXOs
|
||||||
bool skip_locked{true};
|
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