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

@@ -1835,7 +1835,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;
}
}
@@ -4058,14 +4060,14 @@ int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const
int CMerkleTx::GetBlocksToMaturity() const
{
if (!(IsCoinBase() || IsCoinStake()))
if (!(IsCoinBase() || IsCoinStake()))
return 0;
return max(0, (Params().GetConsensus().nCoinbaseMaturity+1) - GetDepthInMainChain());
}
bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, bool fRejectAbsurdFee)
bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, CAmount nAbsurdFee)
{
CValidationState state;
return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, false, fRejectAbsurdFee);
return ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, NULL, false, nAbsurdFee);
}