changeset 26693:ba70d954c8d3

Removed redundant parameter from mempool.PrioritiseTransaction (Also made the `const uint256 hash` parameter a `const uint256& hash` as suggested by @sdaftuar)
author gubatron <gubatron@gmail.com>
date Sun, 19 Feb 2017 10:23:04 -0700
parents 50f5f772fbf2
children 65aa5fcd8ebf
files src/rpc/mining.cpp src/txmempool.cpp src/txmempool.h src/validation.cpp
diffstat 4 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/rpc/mining.cpp	Sun Feb 19 16:02:30 2017 +0100
+++ b/src/rpc/mining.cpp	Sun Feb 19 10:23:04 2017 -0700
@@ -282,7 +282,7 @@
     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;
 }
 
--- a/src/txmempool.cpp	Sun Feb 19 16:02:30 2017 +0100
+++ b/src/txmempool.cpp	Sun Feb 19 10:23:04 2017 -0700
@@ -920,7 +920,7 @@
     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 @@
             }
         }
     }
-    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
--- a/src/txmempool.h	Sun Feb 19 16:02:30 2017 +0100
+++ b/src/txmempool.h	Sun Feb 19 10:23:04 2017 -0700
@@ -555,7 +555,7 @@
     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);
 
--- a/src/validation.cpp	Sun Feb 19 16:02:30 2017 +0100
+++ b/src/validation.cpp	Sun Feb 19 10:23:04 2017 -0700
@@ -4211,7 +4211,7 @@
 
             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 @@
         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());