|
|
|
@ -414,7 +414,7 @@ std::shared_ptr<CWallet> RestoreWallet(WalletContext& context, const fs::path& b
|
|
|
|
|
const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const
|
|
|
|
|
{
|
|
|
|
|
AssertLockHeld(cs_wallet);
|
|
|
|
|
std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(hash);
|
|
|
|
|
const auto it = mapWallet.find(hash);
|
|
|
|
|
if (it == mapWallet.end())
|
|
|
|
|
return nullptr;
|
|
|
|
|
return &(it->second);
|
|
|
|
@ -551,7 +551,7 @@ std::set<uint256> CWallet::GetConflicts(const uint256& txid) const
|
|
|
|
|
std::set<uint256> result;
|
|
|
|
|
AssertLockHeld(cs_wallet);
|
|
|
|
|
|
|
|
|
|
std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(txid);
|
|
|
|
|
const auto it = mapWallet.find(txid);
|
|
|
|
|
if (it == mapWallet.end())
|
|
|
|
|
return result;
|
|
|
|
|
const CWalletTx& wtx = it->second;
|
|
|
|
@ -642,7 +642,7 @@ bool CWallet::IsSpent(const COutPoint& outpoint) const
|
|
|
|
|
|
|
|
|
|
for (TxSpends::const_iterator it = range.first; it != range.second; ++it) {
|
|
|
|
|
const uint256& wtxid = it->second;
|
|
|
|
|
std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find(wtxid);
|
|
|
|
|
const auto mit = mapWallet.find(wtxid);
|
|
|
|
|
if (mit != mapWallet.end()) {
|
|
|
|
|
int depth = GetTxDepthInMainChain(mit->second);
|
|
|
|
|
if (depth > 0 || (depth == 0 && !mit->second.isAbandoned()))
|
|
|
|
@ -1372,7 +1372,7 @@ CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
LOCK(cs_wallet);
|
|
|
|
|
std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
|
|
|
|
|
const auto mi = mapWallet.find(txin.prevout.hash);
|
|
|
|
|
if (mi != mapWallet.end())
|
|
|
|
|
{
|
|
|
|
|
const CWalletTx& prev = (*mi).second;
|
|
|
|
@ -1961,7 +1961,7 @@ bool CWallet::SignTransaction(CMutableTransaction& tx) const
|
|
|
|
|
// Build coins map
|
|
|
|
|
std::map<COutPoint, Coin> coins;
|
|
|
|
|
for (auto& input : tx.vin) {
|
|
|
|
|
std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(input.prevout.hash);
|
|
|
|
|
const auto mi = mapWallet.find(input.prevout.hash);
|
|
|
|
|
if(mi == mapWallet.end() || input.prevout.n >= mi->second.tx->vout.size()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|