Skip to content

Commit

Permalink
DEBUG: log txo detect
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Oct 28, 2024
1 parent 387cd1c commit 9527db6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4735,13 +4735,16 @@ void CWallet::RefreshSingleTxTXOs(const CWalletTx& wtx)
if (it != wtx.m_txos.end()) {
it->second->SetIsMine(ismine);
it->second->SetState(wtx.GetState());
WalletLogPrintf("Updating TXO %s (ismine %d, state %s)\n", outpoint.ToString(), ismine, TxStateString(wtx.GetState()));
} else {
TXOMap::iterator txo_it;
bool txos_inserted = false;
if (m_last_block_processed_height >= 0 && IsSpent(outpoint, /*min_depth=*/1)) {
WalletLogPrintf("Inserting new spent TXO %s (ismine %d, state %s)\n", outpoint.ToString(), ismine, TxStateString(wtx.GetState()));
std::tie(txo_it, txos_inserted) = m_unusable_txos.emplace(outpoint, WalletTXO{txout, ismine, wtx.GetState(), wtx.IsCoinBase(), wtx.m_from_me, wtx.GetTxTime()});
assert(txos_inserted);
} else {
WalletLogPrintf("Inserting new unspent TXO %s (ismine %d, state %s)\n", outpoint.ToString(), ismine, TxStateString(wtx.GetState()));
std::tie(txo_it, txos_inserted) = m_txos.emplace(outpoint, WalletTXO{txout, ismine, wtx.GetState(), wtx.IsCoinBase(), wtx.m_from_me, wtx.GetTxTime()});
}
auto [_, wtx_inserted] = wtx.m_txos.emplace(i, &txo_it->second);
Expand Down

0 comments on commit 9527db6

Please sign in to comment.