Pass as constant reference 337/head
authorsvost <ya.nowa@yandex.ru>
Sun, 1 May 2016 09:12:22 +0000 (12:12 +0300)
committersvost <ya.nowa@yandex.ru>
Sun, 1 May 2016 09:12:22 +0000 (12:12 +0300)
src/checkpoints.cpp
src/checkpoints.h
src/main.h

index d93e559..c308542 100644 (file)
@@ -113,7 +113,7 @@ namespace Checkpoints
     }
 
     // ppcoin: only descendant of current sync-checkpoint is allowed
-    bool ValidateSyncCheckpoint(uint256 hashCheckpoint)
+    bool ValidateSyncCheckpoint(const uint256 &hashCheckpoint)
     {
         if (!mapBlockIndex.count(hashSyncCheckpoint))
             return error("ValidateSyncCheckpoint: block index missing for current sync-checkpoint %s", hashSyncCheckpoint.ToString().c_str());
@@ -259,7 +259,7 @@ namespace Checkpoints
         return true;
     }
 
-    bool WantedByPendingSyncCheckpoint(uint256 hashBlock)
+    bool WantedByPendingSyncCheckpoint(const uint256 &hashBlock)
     {
         LOCK(cs_hashSyncCheckpoint);
         if (hashPendingCheckpoint == 0)
@@ -325,7 +325,7 @@ namespace Checkpoints
             pfrom->AskFor(CInv(MSG_BLOCK, hashPendingCheckpoint));
     }
 
-    bool SetCheckpointPrivKey(string strPrivKey)
+    bool SetCheckpointPrivKey(const string &strPrivKey)
     {
         // Test signing a sync-checkpoint with genesis block
         CSyncCheckpoint checkpoint;
@@ -345,7 +345,7 @@ namespace Checkpoints
         return true;
     }
 
-    bool SendSyncCheckpoint(uint256 hashCheckpoint)
+    bool SendSyncCheckpoint(const uint256 &hashCheckpoint)
     {
         CSyncCheckpoint checkpoint;
         checkpoint.hashCheckpoint = hashCheckpoint;
index 443be29..8f044da 100644 (file)
@@ -55,11 +55,11 @@ namespace Checkpoints
     bool AcceptPendingSyncCheckpoint();
     uint256 AutoSelectSyncCheckpoint();
     bool CheckSync(const uint256& hashBlock, const CBlockIndex* pindexPrev);
-    bool WantedByPendingSyncCheckpoint(uint256 hashBlock);
+    bool WantedByPendingSyncCheckpoint(const uint256 &hashBlock);
     bool ResetSyncCheckpoint();
     void AskForPendingSyncCheckpoint(CNode* pfrom);
-    bool SetCheckpointPrivKey(std::string strPrivKey);
-    bool SendSyncCheckpoint(uint256 hashCheckpoint);
+    bool SetCheckpointPrivKey(const std::string &strPrivKey);
+    bool SendSyncCheckpoint(const uint256 &hashCheckpoint);
     bool IsMatureSyncCheckpoint();
 }
 
index c0f03df..610ce94 100644 (file)
@@ -1644,12 +1644,12 @@ public:
         return mapTx.size();
     }
 
-    bool exists(uint256 hash)
+    bool exists(const uint256 &hash)
     {
         return (mapTx.count(hash) != 0);
     }
 
-    CTransaction& lookup(uint256 hash)
+    CTransaction& lookup(const uint256 &hash)
     {
         return mapTx[hash];
     }