mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Force explicit double -> int conversion for CFeeRate constructor
This resolves an issue where estimatesmartfee would return 999 sat/byte instead of 1000, due to floating point loss of precision Thanks to sipa for suggesting is_integral.
This commit is contained in:
@@ -981,7 +981,7 @@ const CTxMemPool::setEntries & CTxMemPool::GetMemPoolChildren(txiter entry) cons
|
||||
CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const {
|
||||
LOCK(cs);
|
||||
if (!blockSinceLastRollingFeeBump || rollingMinimumFeeRate == 0)
|
||||
return CFeeRate(rollingMinimumFeeRate);
|
||||
return CFeeRate(llround(rollingMinimumFeeRate));
|
||||
|
||||
int64_t time = GetTime();
|
||||
if (time > lastRollingFeeUpdate + 10) {
|
||||
@@ -999,7 +999,7 @@ CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const {
|
||||
return CFeeRate(0);
|
||||
}
|
||||
}
|
||||
return std::max(CFeeRate(rollingMinimumFeeRate), incrementalRelayFee);
|
||||
return std::max(CFeeRate(llround(rollingMinimumFeeRate)), incrementalRelayFee);
|
||||
}
|
||||
|
||||
void CTxMemPool::trackPackageRemoved(const CFeeRate& rate) {
|
||||
|
||||
Reference in New Issue
Block a user