Skip to content

Commit 0889e07

Browse files
committed
tx fees, policy: cast with static_cast instead of C-Style cast
1 parent a0e3eb7 commit 0889e07

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/policy/fees.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,11 +610,11 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
610610
CFeeRate feeRate(entry.GetFee(), entry.GetTxSize());
611611

612612
mapMemPoolTxs[hash].blockHeight = txHeight;
613-
unsigned int bucketIndex = feeStats->NewTx(txHeight, (double)feeRate.GetFeePerK());
613+
unsigned int bucketIndex = feeStats->NewTx(txHeight, static_cast<double>(feeRate.GetFeePerK()));
614614
mapMemPoolTxs[hash].bucketIndex = bucketIndex;
615-
unsigned int bucketIndex2 = shortStats->NewTx(txHeight, (double)feeRate.GetFeePerK());
615+
unsigned int bucketIndex2 = shortStats->NewTx(txHeight, static_cast<double>(feeRate.GetFeePerK()));
616616
assert(bucketIndex == bucketIndex2);
617-
unsigned int bucketIndex3 = longStats->NewTx(txHeight, (double)feeRate.GetFeePerK());
617+
unsigned int bucketIndex3 = longStats->NewTx(txHeight, static_cast<double>(feeRate.GetFeePerK()));
618618
assert(bucketIndex == bucketIndex3);
619619
}
620620

@@ -640,9 +640,9 @@ bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxM
640640
// Feerates are stored and reported as BTC-per-kb:
641641
CFeeRate feeRate(entry->GetFee(), entry->GetTxSize());
642642

643-
feeStats->Record(blocksToConfirm, (double)feeRate.GetFeePerK());
644-
shortStats->Record(blocksToConfirm, (double)feeRate.GetFeePerK());
645-
longStats->Record(blocksToConfirm, (double)feeRate.GetFeePerK());
643+
feeStats->Record(blocksToConfirm, static_cast<double>(feeRate.GetFeePerK()));
644+
shortStats->Record(blocksToConfirm, static_cast<double>(feeRate.GetFeePerK()));
645+
longStats->Record(blocksToConfirm, static_cast<double>(feeRate.GetFeePerK()));
646646
return true;
647647
}
648648

0 commit comments

Comments
 (0)