MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetMinFee

Method GetMinFee

src/txmempool.cpp:976–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974}
975
976CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const {
977 LOCK(cs);
978 if (!blockSinceLastRollingFeeBump || rollingMinimumFeeRate == 0)
979 return CFeeRate(llround(rollingMinimumFeeRate));
980
981 int64_t time = GetTime();
982 if (time > lastRollingFeeUpdate + 10) {
983 double halflife = ROLLING_FEE_HALFLIFE;
984 if (DynamicMemoryUsage() < sizelimit / 4)
985 halflife /= 4;
986 else if (DynamicMemoryUsage() < sizelimit / 2)
987 halflife /= 2;
988
989 rollingMinimumFeeRate = rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife);
990 lastRollingFeeUpdate = time;
991
992 if (rollingMinimumFeeRate < (double)incrementalRelayFee.GetFeePerK() / 2) {
993 rollingMinimumFeeRate = 0;
994 return CFeeRate(0);
995 }
996 }
997 return std::max(CFeeRate(llround(rollingMinimumFeeRate)), incrementalRelayFee);
998}
999
1000void CTxMemPool::trackPackageRemoved(const CFeeRate& rate) {
1001 AssertLockHeld(cs);

Callers 6

SendMessagesMethod · 0.80
AcceptToMemoryPoolWorkerFunction · 0.80
CreateTransactionFunction · 0.80
GetMinimumFeeRateFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
mempoolInfoToJSONFunction · 0.80

Calls 4

GetTimeFunction · 0.85
maxFunction · 0.85
GetFeePerKMethod · 0.80
CFeeRateClass · 0.50

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64