Browse Source

Removed redundant parameter from mempool.PrioritiseTransaction

(Also made the `const uint256 hash` parameter a `const uint256& hash` as suggested by @sdaftuar)
0.15
gubatron 8 years ago
parent
commit
eaea2bbb41
  1. 2
      src/rpc/mining.cpp
  2. 4
      src/txmempool.cpp
  3. 2
      src/txmempool.h
  4. 4
      src/validation.cpp

2
src/rpc/mining.cpp

@ -282,7 +282,7 @@ UniValue prioritisetransaction(const JSONRPCRequest& request) @@ -282,7 +282,7 @@ UniValue prioritisetransaction(const JSONRPCRequest& request)
uint256 hash = ParseHashStr(request.params[0].get_str(), "txid");
CAmount nAmount = request.params[2].get_int64();
mempool.PrioritiseTransaction(hash, request.params[0].get_str(), request.params[1].get_real(), nAmount);
mempool.PrioritiseTransaction(hash, request.params[1].get_real(), nAmount);
return true;
}

4
src/txmempool.cpp

@ -920,7 +920,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein) @@ -920,7 +920,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
return true;
}
void CTxMemPool::PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount& nFeeDelta)
void CTxMemPool::PrioritiseTransaction(const uint256& hash, double dPriorityDelta, const CAmount& nFeeDelta)
{
{
LOCK(cs);
@ -940,7 +940,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256 hash, const std::string str @@ -940,7 +940,7 @@ void CTxMemPool::PrioritiseTransaction(const uint256 hash, const std::string str
}
}
}
LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta, FormatMoney(nFeeDelta));
LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", hash.ToString(), dPriorityDelta, FormatMoney(nFeeDelta));
}
void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const

2
src/txmempool.h

@ -555,7 +555,7 @@ public: @@ -555,7 +555,7 @@ public:
bool HasNoInputsOf(const CTransaction& tx) const;
/** Affect CreateNewBlock prioritisation of transactions */
void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount& nFeeDelta);
void PrioritiseTransaction(const uint256& hash, double dPriorityDelta, const CAmount& nFeeDelta);
void ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const;
void ClearPrioritisation(const uint256 hash);

4
src/validation.cpp

@ -4211,7 +4211,7 @@ bool LoadMempool(void) @@ -4211,7 +4211,7 @@ bool LoadMempool(void)
CAmount amountdelta = nFeeDelta;
if (amountdelta) {
mempool.PrioritiseTransaction(tx->GetHash(), tx->GetHash().ToString(), prioritydummy, amountdelta);
mempool.PrioritiseTransaction(tx->GetHash(), prioritydummy, amountdelta);
}
CValidationState state;
if (nTime + nExpiryTimeout > nNow) {
@ -4232,7 +4232,7 @@ bool LoadMempool(void) @@ -4232,7 +4232,7 @@ bool LoadMempool(void)
file >> mapDeltas;
for (const auto& i : mapDeltas) {
mempool.PrioritiseTransaction(i.first, i.first.ToString(), prioritydummy, i.second);
mempool.PrioritiseTransaction(i.first, prioritydummy, i.second);
}
} catch (const std::exception& e) {
LogPrintf("Failed to deserialize mempool data on disk: %s. Continuing anyway.\n", e.what());

Loading…
Cancel
Save