| 558 | } |
| 559 | |
| 560 | set<uint256> CWallet::GetConflicts(const uint256& txid) const |
| 561 | { |
| 562 | set<uint256> result; |
| 563 | AssertLockHeld(cs_wallet); |
| 564 | |
| 565 | std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(txid); |
| 566 | if (it == mapWallet.end()) |
| 567 | return result; |
| 568 | const CWalletTx& wtx = it->second; |
| 569 | |
| 570 | std::pair<TxSpends::const_iterator, TxSpends::const_iterator> range; |
| 571 | |
| 572 | for (const CTxIn& txin : wtx.vin) { |
| 573 | if (mapTxSpends.count(txin.prevout) <= 1) |
| 574 | continue; // No conflict if zero or one spends |
| 575 | range = mapTxSpends.equal_range(txin.prevout); |
| 576 | for (TxSpends::const_iterator it = range.first; it != range.second; ++it) |
| 577 | result.insert(it->second); |
| 578 | } |
| 579 | return result; |
| 580 | } |
| 581 | |
| 582 | void CWallet::SyncMetaData(pair<TxSpends::iterator, TxSpends::iterator> range) |
| 583 | { |
no test coverage detected