Add accessor for sigops-adjusted weight
What changed, and why it matters
This commit adds a simple read-only helper function (accessor) to a mempool data structure. It exposes a value that was already being computed internally, but does not change any behavior, fix any bug, or introduce any obvious security issue.
No security action required. Review as normal code-quality change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds a new public inline accessor GetAdjustedWeight() to CTxMemPoolEntry in src/kernel/mempool_entry.h. It returns the existing sigops-adjusted weight via the pre-existing helper GetSigOpsAdjustedWeight(nTxWeight, sigOpCost, ::nBytesPerSigOp). No logic is modified; only a new getter is introduced.
Changed components
src/kernel/mempool_entry.hInspect captured patch +1 / −0
diff --git a/src/kernel/mempool_entry.h b/src/kernel/mempool_entry.h
index cd86f366..28c2290c 100644
--- a/src/kernel/mempool_entry.h
+++ b/src/kernel/mempool_entry.h
@@ -138,6 +138,7 @@ public:
{
return GetVirtualTransactionSize(nTxWeight, sigOpCost, ::nBytesPerSigOp);
}
+ int32_t GetAdjustedWeight() const { return GetSigOpsAdjustedWeight(nTxWeight, sigOpCost, ::nBytesPerSigOp); }
int32_t GetTxWeight() const { return nTxWeight; }
std::chrono::seconds GetTime() const { return std::chrono::seconds{nTime}; }
unsigned int GetHeight() const { return entryHeight; }
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.