Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,801 Lines • ▼ Show 20 Lines | |||||
bool CMerkleTx::IsImmatureCoinBase() const { | bool CMerkleTx::IsImmatureCoinBase() const { | ||||
// note GetBlocksToMaturity is 0 for non-coinbase tx | // note GetBlocksToMaturity is 0 for non-coinbase tx | ||||
return GetBlocksToMaturity() > 0; | return GetBlocksToMaturity() > 0; | ||||
} | } | ||||
bool CWalletTx::AcceptToMemoryPool(const Amount nAbsurdFee, | bool CWalletTx::AcceptToMemoryPool(const Amount nAbsurdFee, | ||||
CValidationState &state) { | CValidationState &state) { | ||||
// Quick check to avoid re-setting fInMempool to false | |||||
if (g_mempool.exists(tx->GetId())) { | |||||
return false; | |||||
} | |||||
// We must set fInMempool here - while it will be re-set to true by the | // We must set fInMempool here - while it will be re-set to true by the | ||||
// entered-mempool callback, if we did not there would be a race where a | // entered-mempool callback, if we did not there would be a race where a | ||||
// user could call sendmoney in a loop and hit spurious out of funds errors | // user could call sendmoney in a loop and hit spurious out of funds errors | ||||
// because we think that this newly generated transaction's change is | // because we think that this newly generated transaction's change is | ||||
// unavailable as we're not yet aware that it is in the mempool. | // unavailable as we're not yet aware that it is in the mempool. | ||||
bool ret = ::AcceptToMemoryPool( | bool ret = ::AcceptToMemoryPool( | ||||
GetConfig(), g_mempool, state, tx, true /* fLimitFree */, | GetConfig(), g_mempool, state, tx, true /* fLimitFree */, | ||||
nullptr /* pfMissingInputs */, false /* fOverrideMempoolLimit */, | nullptr /* pfMissingInputs */, false /* fOverrideMempoolLimit */, | ||||
nAbsurdFee); | nAbsurdFee); | ||||
fInMempool = ret; | fInMempool |= ret; | ||||
return ret; | return ret; | ||||
} | } | ||||
void CWallet::LearnRelatedScripts(const CPubKey &key, OutputType type) { | void CWallet::LearnRelatedScripts(const CPubKey &key, OutputType type) { | ||||
// Nothing to do... | // Nothing to do... | ||||
} | } | ||||
void CWallet::LearnAllRelatedScripts(const CPubKey &key) { | void CWallet::LearnAllRelatedScripts(const CPubKey &key) { | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |