mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Add verbose boolean to getrawmempool
Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
This commit is contained in:
@@ -178,3 +178,19 @@ bool CCoinsViewCache::HaveInputs(const CTransaction& tx)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight)
|
||||
{
|
||||
if (tx.IsCoinBase())
|
||||
return 0.0;
|
||||
double dResult = 0.0;
|
||||
BOOST_FOREACH(const CTxIn& txin, tx.vin)
|
||||
{
|
||||
const CCoins &coins = GetCoins(txin.prevout.hash);
|
||||
if (!coins.IsAvailable(txin.prevout.n)) continue;
|
||||
if (coins.nHeight < nHeight) {
|
||||
dResult += coins.vout[txin.prevout.n].nValue * (nHeight-coins.nHeight);
|
||||
}
|
||||
}
|
||||
return tx.ComputePriority(dResult);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user