Add a GetFeePerVSize() accessor to CFeeRate, and use it in the BlockAssembler
What changed, and why it matters
This is a small code cleanup change. It adds a new accessor method to retrieve a fee rate and uses it in one place when building blocks. There is no security-relevant change visible in the diff.
No security action needed. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit introduces CFeeRate::GetFeePerVSize() returning m_feerate, and replaces a call to GetFee(chunk_feerate_vsize.size) with a direct comparison using the new accessor. The logic appears equivalent: it still checks whether the chunk’s fee rate meets the block minimum fee rate. No bounds, type, or arithmetic changes that would indicate a vulnerability are present.
Changed components
src/policy/feerate.hsrc/node/miner.cppInspect captured patch +3 / −1
diff --git a/src/node/miner.cpp b/src/node/miner.cpp
index 3a1e9f65..d11bd5c5 100644
--- a/src/node/miner.cpp
+++ b/src/node/miner.cpp
@@ -252,7 +252,7 @@ void BlockAssembler::addChunks()
while (selected_transactions.size() > 0) {
// Check to see if min fee rate is still respected.
- if (chunk_feerate.fee < m_options.blockMinFeeRate.GetFee(chunk_feerate_vsize.size)) {
+ if (chunk_feerate_vsize << m_options.blockMinFeeRate.GetFeePerVSize()) {
// Everything else we might consider has a lower feerate
return;
}
diff --git a/src/policy/feerate.h b/src/policy/feerate.h
index dfe35c65..5994fe99 100644
--- a/src/policy/feerate.h
+++ b/src/policy/feerate.h
@@ -57,6 +57,8 @@ public:
*/
CAmount GetFee(int32_t virtual_bytes) const;
+ FeePerVSize GetFeePerVSize() const { return m_feerate; }
+
/**
* Return the fee in satoshis for a vsize of 1000 vbytes
*/
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.