File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1212#include < node/types.h>
1313#include < numeric>
1414#include < policy/policy.h>
15+ #include < policy/truc_policy.h>
1516#include < primitives/transaction.h>
1617#include < primitives/transaction_identifier.h>
1718#include < script/script.h>
@@ -386,6 +387,14 @@ CoinsResult AvailableCoins(const CWallet& wallet,
386387 safeTx = false ;
387388 }
388389
390+ if (nDepth == 0 && params.check_version_trucness ) {
391+ if (coinControl->m_version == TRUC_VERSION) {
392+ if (wtx.tx ->version != TRUC_VERSION) continue ;
393+ } else {
394+ if (wtx.tx ->version == TRUC_VERSION) continue ;
395+ }
396+ }
397+
389398 if (only_safe && !safeTx) {
390399 continue ;
391400 }
@@ -484,6 +493,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
484493CoinsResult AvailableCoinsListUnspent (const CWallet& wallet, const CCoinControl* coinControl, CoinFilterParams params)
485494{
486495 params.only_spendable = false ;
496+ params.check_version_trucness = false ;
487497 return AvailableCoins (wallet, coinControl, /* feerate=*/ std::nullopt , params);
488498}
489499
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ struct CoinFilterParams {
8383 bool include_immature_coinbase{false };
8484 // By default, skip locked UTXOs
8585 bool skip_locked{true };
86+ // When true, filter unconfirmed coins by whether their
87+ // version's TRUCness matches what is set by CCoinControl.
88+ bool check_version_trucness{true };
8689};
8790
8891/* *
You can’t perform that action at this time.
0 commit comments