From 75843f112399a444c9835827ad8cf362b34da348 Mon Sep 17 00:00:00 2001 From: svost Date: Sun, 1 May 2016 12:12:22 +0300 Subject: [PATCH] Pass as constant reference --- src/checkpoints.cpp | 8 ++++---- src/checkpoints.h | 6 +++--- src/main.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index d93e559..c308542 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -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; diff --git a/src/checkpoints.h b/src/checkpoints.h index 443be29..8f044da 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -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(); } diff --git a/src/main.h b/src/main.h index c0f03df..610ce94 100644 --- a/src/main.h +++ b/src/main.h @@ -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]; } -- 1.7.1