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.
This commit is contained in:
Alex Morcos
2016-02-12 15:57:15 -05:00
parent 29b2be6ad7
commit 9e072a6e66
15 changed files with 152 additions and 32 deletions

View File

@@ -1268,7 +1268,9 @@ bool CWalletTx::RelayWalletTransaction()
{
if (GetDepthInMainChain() == 0 && !isAbandoned() && InMempool()) {
LogPrintf("Relaying wtx %s\n", GetHash().ToString());
RelayTransaction((CTransaction)*this);
CFeeRate feeRate;
mempool.lookupFeeRate(GetHash(), feeRate);
RelayTransaction((CTransaction)*this, feeRate);
return true;
}
}
@@ -3231,5 +3233,5 @@ int CMerkleTx::GetBlocksToMaturity() const
bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, CAmount nAbsurdFee)
{
CValidationState state;
return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, false, nAbsurdFee);
return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, NULL, false, nAbsurdFee);
}