24 int64_t _nTime,
double _entryPriority,
unsigned int _entryHeight,
25 bool poolHasNoInputsOf,
CAmount _inChainInputValue,
26 bool _spendsCoinbase,
unsigned int _sigOps,
LockPoints lp):
27 tx(_tx), nFee(_nFee), nTime(_nTime), entryPriority(_entryPriority), entryHeight(_entryHeight),
28 hadNoDependencies(poolHasNoInputsOf), inChainInputValue(_inChainInputValue),
29 spendsCoinbase(_spendsCoinbase), sigOpCount(_sigOps), lockPoints(lp)
77 int nChildrenToVisit = 0;
82 while (!stageEntries.empty()) {
83 const txiter cit = *stageEntries.begin();
88 setAllDescendants.insert(cit);
89 stageEntries.erase(cit);
91 BOOST_FOREACH(
const txiter childEntry, setChildren) {
92 cacheMap::iterator cacheIt = cachedDescendants.find(childEntry);
93 if (cacheIt != cachedDescendants.end()) {
96 BOOST_FOREACH(
const txiter cacheEntry, cacheIt->second) {
99 if (setAllDescendants.insert(cacheEntry).second &&
100 !setExclude.count(cacheEntry->GetTx().GetHash()) &&
101 !stageEntries.count(cacheEntry)) {
105 }
else if (!setAllDescendants.count(childEntry)) {
107 if (stageEntries.insert(childEntry).second && !setExclude.count(childEntry->GetTx().GetHash())) {
111 if (nChildrenToVisit > maxDescendantsToVisit) {
118 int64_t modifySize = 0;
120 int64_t modifyCount = 0;
121 BOOST_FOREACH(
txiter cit, setAllDescendants) {
122 if (!setExclude.count(cit->GetTx().GetHash())) {
123 modifySize += cit->GetTxSize();
124 modifyFee += cit->GetModifiedFee();
126 cachedDescendants[updateIt].insert(cit);
143 cacheMap mapMemPoolDescendantsToUpdate;
147 std::set<uint256> setAlreadyIncluded(vHashesToUpdate.begin(), vHashesToUpdate.end());
154 BOOST_REVERSE_FOREACH(
const uint256 &hash, vHashesToUpdate) {
159 if (it ==
mapTx.end()) {
162 std::map<COutPoint, CInPoint>::iterator iter =
mapNextTx.lower_bound(
COutPoint(hash, 0));
165 for (; iter !=
mapNextTx.end() && iter->first.hash == hash; ++iter) {
168 assert(childIter !=
mapTx.end());
171 if (setChildren.insert(childIter).second && !setAlreadyIncluded.count(childHash)) {
188 if (fSearchForParents) {
192 for (
unsigned int i = 0; i < tx.
vin.size(); i++) {
194 if (piter !=
mapTx.end()) {
195 parentHashes.insert(piter);
196 if (parentHashes.size() + 1 > limitAncestorCount) {
197 errString =
strprintf(
"too many unconfirmed parents [limit: %u]", limitAncestorCount);
209 size_t totalSizeWithAncestors = entry.
GetTxSize();
211 while (!parentHashes.empty()) {
212 txiter stageit = *parentHashes.begin();
214 setAncestors.insert(stageit);
215 parentHashes.erase(stageit);
216 totalSizeWithAncestors += stageit->GetTxSize();
218 if (stageit->GetSizeWithDescendants() + entry.
GetTxSize() > limitDescendantSize) {
219 errString =
strprintf(
"exceeds descendant size limit for tx %s [limit: %u]", stageit->GetTx().GetHash().ToString(), limitDescendantSize);
221 }
else if (stageit->GetCountWithDescendants() + 1 > limitDescendantCount) {
222 errString =
strprintf(
"too many descendants for tx %s [limit: %u]", stageit->GetTx().GetHash().ToString(), limitDescendantCount);
224 }
else if (totalSizeWithAncestors > limitAncestorSize) {
225 errString =
strprintf(
"exceeds ancestor size limit [limit: %u]", limitAncestorSize);
230 BOOST_FOREACH(
const txiter &phash, setMemPoolParents) {
232 if (setAncestors.count(phash) == 0) {
233 parentHashes.insert(phash);
235 if (parentHashes.size() + setAncestors.size() + 1 > limitAncestorCount) {
236 errString =
strprintf(
"too many unconfirmed ancestors [limit: %u]", limitAncestorCount);
249 BOOST_FOREACH(
txiter piter, parentIters) {
252 const int64_t updateCount = (add ? 1 : -1);
253 const int64_t updateSize = updateCount * it->GetTxSize();
254 const CAmount updateFee = updateCount * it->GetModifiedFee();
255 BOOST_FOREACH(
txiter ancestorIt, setAncestors) {
263 BOOST_FOREACH(
txiter updateIt, setMemPoolChildren) {
272 const uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();
273 BOOST_FOREACH(
txiter removeIt, entriesToRemove) {
305 BOOST_FOREACH(
txiter removeIt, entriesToRemove) {
329 nTransactionsUpdated(0)
351 std::map<COutPoint, CInPoint>::iterator it =
mapNextTx.lower_bound(
COutPoint(hashTx, 0));
354 while (it !=
mapNextTx.end() && it->first.hash == hashTx) {
355 coins.
Spend(it->first.n);
378 indexed_transaction_set::iterator newit =
mapTx.insert(entry).first;
384 std::map<uint256, std::pair<double, CAmount> >::const_iterator pos =
mapDeltas.find(hash);
386 const std::pair<double, CAmount> &deltas = pos->second;
398 std::set<uint256> setParentTransactions;
399 for (
unsigned int i = 0; i < tx.
vin.size(); i++) {
401 setParentTransactions.insert(tx.
vin[i].prevout.hash);
411 BOOST_FOREACH (
const uint256 &phash, setParentTransactions) {
413 if (pit !=
mapTx.end()) {
430 std::vector<CMempoolAddressDeltaKey> inserted;
433 for (
unsigned int j = 0; j < tx.
vin.size(); j++) {
441 inserted.push_back(
key);
447 inserted.push_back(
key);
451 for (
unsigned int k = 0; k < tx.
vout.size(); k++) {
453 if (
out.scriptPubKey.IsPayToScriptHash()) {
454 vector<unsigned char> hashBytes(
out.scriptPubKey.begin()+2,
out.scriptPubKey.begin()+22);
457 inserted.push_back(
key);
458 }
else if (
out.scriptPubKey.IsPayToPublicKeyHash()) {
459 vector<unsigned char> hashBytes(
out.scriptPubKey.begin()+3,
out.scriptPubKey.begin()+23);
460 std::pair<addressDeltaMap::iterator,bool> ret;
463 inserted.push_back(
key);
471 std::vector<std::pair<CMempoolAddressDeltaKey, CMempoolAddressDelta> > &results)
474 for (std::vector<std::pair<uint160, int> >::iterator it = addresses.begin(); it != addresses.end(); it++) {
476 while (ait !=
mapAddress.end() && (*ait).first.addressBytes == (*it).first && (*ait).first.type == (*it).second) {
477 results.push_back(*ait);
490 std::vector<CMempoolAddressDeltaKey> keys = (*it).second;
491 for (std::vector<CMempoolAddressDeltaKey>::iterator mit = keys.begin(); mit != keys.end(); mit++) {
505 std::vector<CSpentIndexKey> inserted;
508 for (
unsigned int j = 0; j < tx.
vin.size(); j++) {
529 inserted.push_back(
key);
539 mapSpentIndex::iterator it;
555 std::vector<CSpentIndexKey> keys = (*it).second;
556 for (std::vector<CSpentIndexKey>::iterator mit = keys.begin(); mit != keys.end(); mit++) {
568 BOOST_FOREACH(
const CTxIn& txin, it->GetTx().vin)
591 if (setDescendants.count(entryit) == 0) {
592 stage.insert(entryit);
597 while (!stage.empty()) {
598 txiter it = *stage.begin();
599 setDescendants.insert(it);
603 BOOST_FOREACH(
const txiter &childiter, setChildren) {
604 if (!setDescendants.count(childiter)) {
605 stage.insert(childiter);
618 if (origit !=
mapTx.end()) {
619 txToRemove.insert(origit);
620 }
else if (fRecursive) {
625 for (
unsigned int i = 0; i < origTx.
vout.size(); i++) {
629 txiter nextit =
mapTx.find(it->second.ptx->GetHash());
630 assert(nextit !=
mapTx.end());
631 txToRemove.insert(nextit);
636 BOOST_FOREACH(
txiter it, txToRemove) {
640 setAllRemoves.swap(txToRemove);
642 BOOST_FOREACH(
txiter it, setAllRemoves) {
643 removed.push_back(it->GetTx());
653 list<CTransaction> transactionsToRemove;
654 for (indexed_transaction_set::const_iterator it =
mapTx.begin(); it !=
mapTx.end(); it++) {
661 transactionsToRemove.push_back(tx);
662 }
else if (it->GetSpendsCoinbase()) {
663 BOOST_FOREACH(
const CTxIn& txin, tx.
vin) {
664 indexed_transaction_set::const_iterator it2 =
mapTx.find(txin.
prevout.
hash);
665 if (it2 !=
mapTx.end())
670 transactionsToRemove.push_back(tx);
679 BOOST_FOREACH(
const CTransaction& tx, transactionsToRemove) {
680 list<CTransaction> removed;
681 remove(tx, removed,
true);
688 list<CTransaction>
result;
690 BOOST_FOREACH(
const CTxIn &txin, tx.
vin) {
694 if (txConflict != tx)
696 remove(txConflict, removed,
true);
707 std::list<CTransaction>& conflicts,
bool fCurrentEstimate)
710 std::vector<CTxMemPoolEntry> entries;
715 indexed_transaction_set::iterator i =
mapTx.find(hash);
716 if (i !=
mapTx.end())
717 entries.push_back(*i);
721 std::list<CTransaction> dummy;
722 remove(tx, dummy,
false);
759 LogPrint(
"mempool",
"Checking mempool with %u transactions and %u inputs\n", (
unsigned int)
mapTx.size(), (
unsigned int)
mapNextTx.size());
761 uint64_t checkTotal = 0;
762 uint64_t innerUsage = 0;
764 CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(pcoins));
767 list<const CTxMemPoolEntry*> waitingOnDependants;
768 for (indexed_transaction_set::const_iterator it =
mapTx.begin(); it !=
mapTx.end(); it++) {
770 checkTotal += it->GetTxSize();
771 innerUsage += it->DynamicMemoryUsage();
773 txlinksMap::const_iterator linksiter =
mapLinks.find(it);
774 assert(linksiter !=
mapLinks.end());
775 const TxLinks &links = linksiter->second;
777 bool fDependsWait =
false;
779 BOOST_FOREACH(
const CTxIn &txin, tx.
vin) {
781 indexed_transaction_set::const_iterator it2 =
mapTx.find(txin.
prevout.
hash);
782 if (it2 !=
mapTx.end()) {
786 setParentCheck.insert(it2);
792 std::map<COutPoint, CInPoint>::const_iterator it3 =
mapNextTx.find(txin.
prevout);
794 assert(it3->second.ptx == &tx);
795 assert(it3->second.n == i);
801 std::map<COutPoint, CInPoint>::const_iterator iter =
mapNextTx.lower_bound(
COutPoint(it->GetTx().GetHash(), 0));
802 int64_t childSizes = 0;
804 for (; iter !=
mapNextTx.end() && iter->first.hash == it->GetTx().GetHash(); ++iter) {
805 txiter childit =
mapTx.find(iter->second.ptx->GetHash());
806 assert(childit !=
mapTx.end());
807 if (setChildrenCheck.insert(childit).second) {
808 childSizes += childit->GetTxSize();
809 childModFee += childit->GetModifiedFee();
815 if (!it->IsDirty()) {
816 assert(it->GetSizeWithDescendants() >= childSizes + it->GetTxSize());
818 assert(it->GetSizeWithDescendants() == it->GetTxSize());
819 assert(it->GetModFeesWithDescendants() == it->GetModifiedFee());
823 waitingOnDependants.push_back(&(*it));
826 assert(
CheckInputs(tx, state, mempoolDuplicate,
false, 0,
false, NULL));
830 unsigned int stepsSinceLastRemove = 0;
831 while (!waitingOnDependants.empty()) {
833 waitingOnDependants.pop_front();
836 waitingOnDependants.push_back(entry);
837 stepsSinceLastRemove++;
838 assert(stepsSinceLastRemove < waitingOnDependants.size());
840 assert(
CheckInputs(entry->
GetTx(), state, mempoolDuplicate,
false, 0,
false, NULL));
842 stepsSinceLastRemove = 0;
845 for (std::map<COutPoint, CInPoint>::const_iterator it =
mapNextTx.begin(); it !=
mapNextTx.end(); it++) {
847 indexed_transaction_set::const_iterator it2 =
mapTx.find(hash);
849 assert(it2 !=
mapTx.end());
850 assert(&tx == it->second.ptx);
851 assert(tx.
vin.size() > it->second.n);
852 assert(it->first == it->second.ptx->vin[it->second.n].prevout);
864 vtxid.reserve(
mapTx.size());
865 for (indexed_transaction_set::iterator mi =
mapTx.begin(); mi !=
mapTx.end(); ++mi)
866 vtxid.push_back(mi->GetTx().GetHash());
872 indexed_transaction_set::const_iterator i =
mapTx.find(hash);
873 if (i ==
mapTx.end())
return false;
908 catch (
const std::exception&) {
909 LogPrintf(
"CTxMemPool::WriteFeeEstimates(): unable to write policy estimator data (non-fatal)\n");
919 int nVersionRequired, nVersionThatWrote;
920 filein >> nVersionRequired >> nVersionThatWrote;
922 return error(
"CTxMemPool::ReadFeeEstimates(): up-version (%d) fee estimate file", nVersionRequired);
927 catch (
const std::exception&) {
928 LogPrintf(
"CTxMemPool::ReadFeeEstimates(): unable to read policy estimator data (non-fatal)\n");
938 std::pair<double, CAmount> &deltas =
mapDeltas[hash];
939 deltas.first += dPriorityDelta;
940 deltas.second += nFeeDelta;
942 if (it !=
mapTx.end()) {
946 uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();
949 BOOST_FOREACH(
txiter ancestorIt, setAncestors) {
954 LogPrintf(
"PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta,
FormatMoney(nFeeDelta));
960 std::map<uint256, std::pair<double, CAmount> >::const_iterator pos =
mapDeltas.find(hash);
963 const std::pair<double, CAmount> &deltas = pos->second;
964 dPriorityDelta += deltas.first;
965 nFeeDelta += deltas.second;
976 for (
unsigned int i = 0; i < tx.
vin.size(); i++)
1009 BOOST_FOREACH(
const txiter& it, stage) {
1016 indexed_transaction_set::nth_index<2>::type::iterator it =
mapTx.get<2>().begin();
1018 while (it !=
mapTx.get<2>().end() && it->GetTime() < time) {
1019 toremove.insert(
mapTx.project<0>(it));
1023 BOOST_FOREACH(
txiter removeit, toremove) {
1027 return stage.size();
1034 uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();
1037 return addUnchecked(hash, entry, setAncestors, fCurrentEstimate);
1053 if (add &&
mapLinks[entry].parents.insert(parent).second) {
1055 }
else if (!add &&
mapLinks[entry].parents.erase(parent)) {
1062 assert (entry !=
mapTx.end());
1063 txlinksMap::const_iterator it =
mapLinks.find(entry);
1065 return it->second.parents;
1070 assert (entry !=
mapTx.end());
1071 txlinksMap::const_iterator it =
mapLinks.find(entry);
1073 return it->second.children;
1119 unsigned nTxnRemoved = 0;
1122 indexed_transaction_set::nth_index<1>::type::iterator it =
mapTx.get<1>().begin();
1128 CFeeRate removed(it->GetModFeesWithDescendants(), it->GetSizeWithDescendants());
1131 maxFeeRateRemoved = std::max(maxFeeRateRemoved, removed);
1135 nTxnRemoved += stage.size();
1137 std::vector<CTransaction> txn;
1138 if (pvNoSpendsRemaining) {
1139 txn.reserve(stage.size());
1140 BOOST_FOREACH(
txiter it, stage)
1141 txn.push_back(it->GetTx());
1144 if (pvNoSpendsRemaining) {
1146 BOOST_FOREACH(
const CTxIn& txin, tx.
vin) {
1151 pvNoSpendsRemaining->push_back(txin.
prevout.
hash);
1157 if (maxFeeRateRemoved >
CFeeRate(0))
1158 LogPrint(
"mempool",
"Removed %u txn, rolling minimum fee bumped to %s\n", nTxnRemoved, maxFeeRateRemoved.
ToString());
int64_t lastRollingFeeUpdate
void TrimToSize(size_t sizelimit, std::vector< uint256 > *pvNoSpendsRemaining=NULL)
void removeConflicts(const CTransaction &tx, std::list< CTransaction > &removed)
void UpdateForRemoveFromMempool(const setEntries &entriesToRemove)
double estimateSmartPriority(int confTarget, int *answerFoundAtTarget, const CTxMemPool &pool)
void UpdateFeeDelta(int64_t feeDelta)
bool IsPayToPublicKeyHash() const
void processTransaction(const CTxMemPoolEntry &entry, bool fCurrentEstimate)
unsigned int entryHeight
Priority when entering the mempool.
void remove(const CTransaction &tx, std::list< CTransaction > &removed, bool fRecursive=false)
addressDeltaMapInserted mapAddressInserted
size_t nUsageSize
... and modified size for priority
void queryHashes(std::vector< uint256 > &vtxid)
bool CheckInputs(const CTransaction &tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, bool cacheStore, std::vector< CScriptCheck > *pvChecks)
uint64_t GetHash(const uint256 &salt) const
static size_t DynamicUsage(const int8_t &v)
bool ReadFeeEstimates(CAutoFile &filein)
CFeeRate estimateSmartFee(int nBlocks, int *answerFoundAtBlocks=NULL) const
std::map< txiter, setEntries, CompareIteratorByHash > cacheMap
unsigned int nTransactionsUpdated
Value n means that n times in 2^32 we check.
bool GetCoins(const uint256 &txid, CCoins &coins) const
Retrieve the CCoins (unspent transaction outputs) for a given txid.
bool removeAddressIndex(const uint256 txhash)
double estimateSmartPriority(int nBlocks, int *answerFoundAtBlocks=NULL) const
bool IsAvailable(unsigned int nPos) const
check whether a particular output is still available
CAmount nModFeesWithDescendants
... and size
int64_t feeDelta
Legacy sig ops plus P2SH sig op count.
double entryPriority
Local time when entering the mempool.
static const int COINBASE_MATURITY
std::map< COutPoint, CInPoint > mapNextTx
void UpdateAncestorsOf(bool add, txiter hash, setEntries &setAncestors)
CFeeRate minReasonableRelayFee
sum of dynamic memory usage of all the map elements (NOT the maps themselves)
void UpdateParent(txiter entry, txiter parent, bool add)
CAmount GetValueOut() const
void AddTransactionsUpdated(unsigned int n)
const CTxOut & GetOutputFor(const CTxIn &input) const
indexed_transaction_set mapTx
void UpdateTransactionsFromBlock(const std::vector< uint256 > &hashesToUpdate)
CTxMemPool(const CFeeRate &_minReasonableRelayFee)
static uint32_t insecure_rand(void)
bool CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntries &setAncestors, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString, bool fSearchForParents=true)
CFeeRate estimateFee(int confTarget)
bool removeSpentIndex(const uint256 txhash)
void UpdateLockPoints(const LockPoints &lp)
virtual bool GetCoins(const uint256 &txid, CCoins &coins) const
Retrieve the CCoins (unspent transaction outputs) for a given txid.
bool lookup(uint256 hash, CTransaction &result) const
void ClearPrioritisation(const uint256 hash)
mapSpentIndexInserted mapSpentInserted
void ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const
bool getSpentIndex(CSpentIndexKey &key, CSpentIndexValue &value)
bool exists(uint256 hash) const
#define AssertLockHeld(cs)
LockPoints lockPoints
Used for determining the priority of the transaction for mining in a block.
CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool &pool)
bool HasNoInputsOf(const CTransaction &tx) const
bool CheckFinalTx(const CTransaction &tx, int flags)
indexed_transaction_set::nth_index< 0 >::type::iterator txiter
bool blockSinceLastRollingFeeBump
uint64_t nSizeWithDescendants
number of descendant transactions
void CalculateDescendants(txiter it, setEntries &setDescendants)
const setEntries & GetMemPoolParents(txiter entry) const
unsigned int GetSerializeSize(char a, int, int=0)
void UpdateMinFee(const CFeeRate &_minReasonableRelayFee)
bool Spend(uint32_t nPos)
mark a vout spent
static int LogPrint(const char *category, const char *format)
void removeForBlock(const std::vector< CTransaction > &vtx, unsigned int nBlockHeight, std::list< CTransaction > &conflicts, bool fCurrentEstimate=true)
const CTransaction & GetTx() const
std::string ToString() const
size_t DynamicMemoryUsage() const
uint64_t cachedInnerUsage
sum of all mempool tx' byte sizes
addressDeltaMap mapAddress
CTxMemPoolEntry(const CTransaction &_tx, const CAmount &_nFee, int64_t _nTime, double _entryPriority, unsigned int _entryHeight, bool poolHasNoInputsOf, CAmount _inChainInputValue, bool spendsCoinbase, unsigned int nSigOps, LockPoints lp)
... and total fees (all including us)
CAmount GetFeePerK() const
void UpdateChildrenForRemoval(txiter entry)
static bool error(const char *format)
static const int ROLLING_FEE_HALFLIFE
void check(const CCoinsViewCache *pcoins) const
size_t nTxSize
Cached to avoid expensive parent-transaction lookups.
bool HaveInputs(const CTransaction &tx) const
Check whether all prevouts of the transaction are present in the UTXO set represented by this view...
size_t nModSize
... and avoid recomputing tx size
bool TestLockPointValidity(const LockPoints *lp)
virtual bool HaveCoins(const uint256 &txid) const
bool IsPayToScriptHash() const
void removeUnchecked(txiter entry)
std::string FormatMoney(const CAmount &n)
bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints *lp, bool useExistingLockPoints)
void addAddressIndex(const CTxMemPoolEntry &entry, const CCoinsViewCache &view)
CAmount inChainInputValue
Not dependent on any other txs when it entered the mempool.
std::set< txiter, CompareIteratorByHash > setEntries
void trackPackageRemoved(const CFeeRate &rate)
minimum fee to get into the pool, decreases exponentially
static size_t MallocUsage(size_t alloc)
unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const
size_t DynamicMemoryUsage() const
std::map< uint256, std::pair< double, CAmount > > mapDeltas
bool getAddressIndex(std::vector< std::pair< uint160, int > > &addresses, std::vector< std::pair< CMempoolAddressDeltaKey, CMempoolAddressDelta > > &results)
const std::vector< CTxIn > vin
int64_t GetModifiedFee() const
const setEntries & GetMemPoolChildren(txiter entry) const
bool HaveCoins(const uint256 &txid) const
uint64_t nCountWithDescendants
Track the height and time at which tx was final.
static const int PROTOCOL_VERSION
const uint256 & GetHash() const
void UpdateChild(txiter entry, txiter child, bool add)
void removeTx(uint256 hash)
double rollingMinimumFeeRate
void addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCache &view)
bool WriteFeeEstimates(CAutoFile &fileout) const
void pruneSpent(const uint256 &hash, CCoins &coins)
CFeeRate GetMinFee(size_t sizelimit) const
void Read(CAutoFile &filein)
const std::vector< CTxOut > vout
void processBlock(unsigned int nBlockHeight, std::vector< CTxMemPoolEntry > &entries, bool fCurrentEstimate)
CCoinsViewMemPool(CCoinsView *baseIn, CTxMemPool &mempoolIn)
static size_t IncrementalDynamicUsage(const std::set< X, Y > &s)
static size_t RecursiveDynamicUsage(const CScript &script)
double GetPriority(unsigned int currentHeight) const
void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount &nFeeDelta)
static const unsigned int MEMPOOL_HEIGHT
int64_t GetTime()
For unit testing.
CFeeRate estimateFee(int nBlocks) const
void UpdateCoins(const CTransaction &tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight)
CBlockPolicyEstimator * minerPolicyEstimator
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags)
void RemoveStaged(setEntries &stage)
static const int CLIENT_VERSION
void Write(CAutoFile &fileout)
bool UpdateForDescendants(txiter updateIt, int maxDescendantsToVisit, cacheMap &cachedDescendants, const std::set< uint256 > &setExclude)
void UpdateState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount)
double estimatePriority(int nBlocks) const
bool addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, bool fCurrentEstimate=true)
unsigned int GetTransactionsUpdated() const
double estimatePriority(int confTarget)
int nHeight
at which height this transaction was included in the active block chain
const CCoins * AccessCoins(const uint256 &txid) const