Skip to content

Commit eaea2bb

Browse files
committed
Removed redundant parameter from mempool.PrioritiseTransaction
(Also made the `const uint256 hash` parameter a `const uint256& hash` as suggested by @sdaftuar)
1 parent 390a39b commit eaea2bb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ UniValue prioritisetransaction(const JSONRPCRequest& request)
282282
uint256 hash = ParseHashStr(request.params[0].get_str(), "txid");
283283
CAmount nAmount = request.params[2].get_int64();
284284

285-
mempool.PrioritiseTransaction(hash, request.params[0].get_str(), request.params[1].get_real(), nAmount);
285+
mempool.PrioritiseTransaction(hash, request.params[1].get_real(), nAmount);
286286
return true;
287287
}
288288

src/txmempool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
920920
return true;
921921
}
922922

923-
void CTxMemPool::PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount& nFeeDelta)
923+
void CTxMemPool::PrioritiseTransaction(const uint256& hash, double dPriorityDelta, const CAmount& nFeeDelta)
924924
{
925925
{
926926
LOCK(cs);
@@ -940,7 +940,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256 hash, const std::string str
940940
}
941941
}
942942
}
943-
LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta, FormatMoney(nFeeDelta));
943+
LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", hash.ToString(), dPriorityDelta, FormatMoney(nFeeDelta));
944944
}
945945

946946
void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ class CTxMemPool
555555
bool HasNoInputsOf(const CTransaction& tx) const;
556556

557557
/** Affect CreateNewBlock prioritisation of transactions */
558-
void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount& nFeeDelta);
558+
void PrioritiseTransaction(const uint256& hash, double dPriorityDelta, const CAmount& nFeeDelta);
559559
void ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const;
560560
void ClearPrioritisation(const uint256 hash);
561561

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4211,7 +4211,7 @@ bool LoadMempool(void)
42114211

42124212
CAmount amountdelta = nFeeDelta;
42134213
if (amountdelta) {
4214-
mempool.PrioritiseTransaction(tx->GetHash(), tx->GetHash().ToString(), prioritydummy, amountdelta);
4214+
mempool.PrioritiseTransaction(tx->GetHash(), prioritydummy, amountdelta);
42154215
}
42164216
CValidationState state;
42174217
if (nTime + nExpiryTimeout > nNow) {
@@ -4232,7 +4232,7 @@ bool LoadMempool(void)
42324232
file >> mapDeltas;
42334233

42344234
for (const auto& i : mapDeltas) {
4235-
mempool.PrioritiseTransaction(i.first, i.first.ToString(), prioritydummy, i.second);
4235+
mempool.PrioritiseTransaction(i.first, prioritydummy, i.second);
42364236
}
42374237
} catch (const std::exception& e) {
42384238
LogPrintf("Failed to deserialize mempool data on disk: %s. Continuing anyway.\n", e.what());

0 commit comments

Comments
 (0)