Log calls to GetFilteredNotes and only warn when witness root is actually invalid

This commit is contained in:
Duke
2025-08-21 01:59:20 -04:00
parent b0cbcc6152
commit 7c434ba030

View File

@@ -1846,12 +1846,10 @@ void CWallet::GetSaplingNoteWitnesses(std::vector<SaplingOutPoint> notes,
rt = witnesses[i]->root();
} else {
if(*rt == witnesses[i]->root()) {
//fprintf(stderr,"%s: rt=%s\n",__func__,rt.GetHash().ToString().c_str());
//fprintf(stderr,"%s: witnesses[%d]->root()=%s\n",__func__,i,witnesses[i]->root().GetHash().ToString().c_str());
} else {
// Something is fucky
std::string err = string("CWallet::GetSaplingNoteWitnesses: Invalid witness root! rt=") + rt.get().ToString();
err += string("\n!= witness[i]->root()=") + witnesses[i]->root().ToString();
//throw std::logic_error(err);
fprintf(stderr,"%s: IGNORING %s\n", __func__,err.c_str());
}
@@ -4880,6 +4878,8 @@ void CWallet::GetFilteredNotes(
{
LOCK2(cs_main, cs_wallet);
LogPrintf("%s ignoreLocked=%d\n", __func__, ignoreLocked);
for (auto & p : mapWallet) {
CWalletTx wtx = p.second;