Skip to content

Commit fa84a49

Browse files
author
MarcoFalke
committed
Use CAmount for fee delta and modified fee
1 parent fa8857c commit fa84a49

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/node/miner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct CTxMemPoolModifiedEntry {
4545
nSigOpCostWithAncestors = entry->GetSigOpCostWithAncestors();
4646
}
4747

48-
int64_t GetModifiedFee() const { return iter->GetModifiedFee(); }
48+
CAmount GetModifiedFee() const { return iter->GetModifiedFee(); }
4949
uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; }
5050
CAmount GetModFeesWithAncestors() const { return nModFeesWithAncestors; }
5151
size_t GetTxSize() const { return iter->GetTxSize(); }

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& tx, CAmount fee,
8989
nModFeesWithAncestors{nFee},
9090
nSigOpCostWithAncestors{sigOpCost} {}
9191

92-
void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta)
92+
void CTxMemPoolEntry::UpdateFeeDelta(CAmount newFeeDelta)
9393
{
9494
nModFeesWithDescendants += newFeeDelta - feeDelta;
9595
nModFeesWithAncestors += newFeeDelta - feeDelta;

src/txmempool.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class CTxMemPoolEntry
101101
const unsigned int entryHeight; //!< Chain height when entering the mempool
102102
const bool spendsCoinbase; //!< keep track of transactions that spend a coinbase
103103
const int64_t sigOpCost; //!< Total sigop cost
104-
int64_t feeDelta{0}; //!< Used for determining the priority of the transaction for mining in a block
104+
CAmount feeDelta{0}; //!< Used for determining the priority of the transaction for mining in a block
105105
LockPoints lockPoints; //!< Track the height and time at which tx was final
106106

107107
// Information about descendants of this transaction that are in the
@@ -131,7 +131,7 @@ class CTxMemPoolEntry
131131
std::chrono::seconds GetTime() const { return std::chrono::seconds{nTime}; }
132132
unsigned int GetHeight() const { return entryHeight; }
133133
int64_t GetSigOpCost() const { return sigOpCost; }
134-
int64_t GetModifiedFee() const { return nFee + feeDelta; }
134+
CAmount GetModifiedFee() const { return nFee + feeDelta; }
135135
size_t DynamicMemoryUsage() const { return nUsageSize; }
136136
const LockPoints& GetLockPoints() const { return lockPoints; }
137137

@@ -140,8 +140,8 @@ class CTxMemPoolEntry
140140
// Adjusts the ancestor state
141141
void UpdateAncestorState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount, int64_t modifySigOps);
142142
// Updates the fee delta used for mining priority score, and the
143-
// modified fees with descendants.
144-
void UpdateFeeDelta(int64_t feeDelta);
143+
// modified fees with descendants/ancestors.
144+
void UpdateFeeDelta(CAmount newFeeDelta);
145145
// Update the LockPoints after a reorg
146146
void UpdateLockPoints(const LockPoints& lp);
147147

0 commit comments

Comments
 (0)