MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetConflicts

Method GetConflicts

src/wallet/wallet.cpp:519–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519std::set<uint256> CWallet::GetConflicts(const uint256& txid) const
520{
521 std::set<uint256> result;
522 AssertLockHeld(cs_wallet);
523
524 std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(txid);
525 if (it == mapWallet.end())
526 return result;
527 const CWalletTx& wtx = it->second;
528
529 std::pair<TxSpends::const_iterator, TxSpends::const_iterator> range;
530
531 for (const CTxIn& txin : wtx.tx->vin)
532 {
533 if (mapTxSpends.count(txin.prevout) <= 1)
534 continue; // No conflict if zero or one spends
535 range = mapTxSpends.equal_range(txin.prevout);
536 for (TxSpends::const_iterator _it = range.first; _it != range.second; ++_it)
537 result.insert(_it->second);
538 }
539 return result;
540}
541
542bool CWallet::HasWalletSpend(const uint256& txid) const
543{

Callers 1

WalletTxToJSONFunction · 0.80

Calls 5

findMethod · 0.45
endMethod · 0.45
countMethod · 0.45
insertMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected