MCPcopy Create free account
hub / github.com/LUX-Core/lux / GetPriority

Method GetPriority

src/coins.cpp:330–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330double CCoinsViewCache::GetPriority(const CTransaction& tx, int nHeight, CAmount &inChainInputValue) const
331{
332 inChainInputValue = 0;
333 if (tx.IsCoinGenerated())
334 return 0.0;
335 double dResult = 0.0;
336 for (const CTxIn& txin : tx.vin) {
337 const CCoins* coins = AccessCoins(txin.prevout.hash);
338 assert(coins);
339 if (!coins->IsAvailable(txin.prevout.n)) continue;
340 if (coins->nHeight < nHeight) {
341 dResult += coins->vout[txin.prevout.n].nValue * (nHeight - coins->nHeight);
342 inChainInputValue += coins->vout[txin.prevout.n].nValue;
343 }
344 }
345 return tx.ComputePriority(dResult);
346}
347
348CCoinsModifier::CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_, size_t usage) : cache(cache_), it(it_), cachedCoinUsage(usage)
349{

Callers 7

getrawmempoolFunction · 0.45
AddToBlockMethod · 0.45
addPriorityTxsMethod · 0.45
AcceptToMemoryPoolFunction · 0.45
AcceptableInputsFunction · 0.45
processTransactionMethod · 0.45
processBlockTxMethod · 0.45

Calls 3

IsAvailableMethod · 0.80
ComputePriorityMethod · 0.80
IsCoinGeneratedMethod · 0.45

Tested by

no test coverage detected