diff options
| author | Alex Morcos <[email protected]> | 2016-02-12 15:57:15 -0500 |
|---|---|---|
| committer | Alex Morcos <[email protected]> | 2016-03-21 10:46:25 -0400 |
| commit | 9e072a6e66efbda7d39bf61eded21d2b324323be (patch) | |
| tree | c9e3686bb2b7cdb50254656a7302d66ac976f467 /src/txmempool.cpp | |
| parent | Merge #7692: Remove p2p alert system (diff) | |
| download | discoin-9e072a6e66efbda7d39bf61eded21d2b324323be.tar.xz discoin-9e072a6e66efbda7d39bf61eded21d2b324323be.zip | |
Implement "feefilter" P2P message.
The "feefilter" p2p message is used to inform other nodes of your mempool min fee which is the feerate that any new transaction must meet to be accepted to your mempool. This will allow them to filter invs to you according to this feerate.
Diffstat (limited to 'src/txmempool.cpp')
| -rw-r--r-- | src/txmempool.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 088e5edde..52c779311 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -771,6 +771,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); |