From e753fadfd01cb8a4a8de3bddc7391481551cca89 Mon Sep 17 00:00:00 2001 From: glozow Date: Thu, 2 Oct 2025 17:52:16 -0400 Subject: [PATCH] [wallet] never try to spend from unconfirmed TRUC that already has ancestors --- src/wallet/spend.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index 146fb49ea78..5654c8f3d49 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -403,6 +403,11 @@ CoinsResult AvailableCoins(const CWallet& wallet, if (wtx.tx->version != TRUC_VERSION) continue; // this unconfirmed v3 transaction already has a child if (wtx.truc_child_in_mempool.has_value()) continue; + + // this unconfirmed v3 transaction has a parent: spending would create a third generation + size_t ancestors, descendants; + wallet.chain().getTransactionAncestry(wtx.tx->GetHash(), ancestors, descendants); + if (ancestors > 1) continue; } else { if (wtx.tx->version == TRUC_VERSION) continue; Assume(!wtx.truc_child_in_mempool.has_value());