Implement "feefilter" P2P message.

This commit is contained in:
Alex Morcos
2016-02-12 15:57:15 -05:00
committed by lateminer
parent 41ffefbe33
commit b821da64ef
16 changed files with 158 additions and 39 deletions

View File

@@ -770,6 +770,16 @@ bool CTxMemPool::lookup(uint256 hash, CTransaction& result) const
return true;
}
bool CTxMemPool::lookupFeeRate(const uint256& hash, CFeeRate& feeRate) const
{
LOCK(cs);
indexed_transaction_set::const_iterator i = mapTx.find(hash);
if (i == mapTx.end())
return false;
feeRate = CFeeRate(i->GetFee(), i->GetTxSize());
return true;
}
CFeeRate CTxMemPool::estimateFee(int nBlocks) const
{
LOCK(cs);