Browse Source

Merge #9801: Removed redundant parameter from mempool.PrioritiseTransaction

eaea2bb Removed redundant parameter from mempool.PrioritiseTransaction (gubatron)
0.15
Wladimir J. van der Laan 8 years ago
parent
commit
a8c5751038
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  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)
uint256 hash = ParseHashStr(request.params[0].get_str(), "txid"); uint256 hash = ParseHashStr(request.params[0].get_str(), "txid");
CAmount nAmount = request.params[2].get_int64(); 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; return true;
} }

4
src/txmempool.cpp

@ -920,7 +920,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
return true; 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); LOCK(cs);
@ -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 void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const

2
src/txmempool.h

@ -555,7 +555,7 @@ public:
bool HasNoInputsOf(const CTransaction& tx) const; bool HasNoInputsOf(const CTransaction& tx) const;
/** Affect CreateNewBlock prioritisation of transactions */ /** 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 ApplyDeltas(const uint256 hash, double &dPriorityDelta, CAmount &nFeeDelta) const;
void ClearPrioritisation(const uint256 hash); void ClearPrioritisation(const uint256 hash);

4
src/validation.cpp

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

Loading…
Cancel
Save