From 886f45379af844788ade062f95bcb77eaeacca52 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 9 Feb 2015 13:36:45 -0700 Subject: [PATCH] fixed caching --- src/masternode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/masternode.cpp b/src/masternode.cpp index 1bc188866..a94bd1ba3 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -531,7 +531,7 @@ bool GetBlockHash(uint256& hash, int nBlockHeight) for (unsigned int i = 1; BlockReading && BlockReading->nHeight > 0; i++) { if(n >= nBlocksAgo){ hash = BlockReading->GetBlockHash(); - mapCacheBlockHashes[nBlockHeight-n] = hash; + mapCacheBlockHashes[nBlockHeight] = hash; return true; } n++; @@ -649,7 +649,7 @@ uint64_t CMasternodePayments::CalculateScore(uint256 blockHash, CTxIn& vin) //printf(" -- CMasternodePayments CalculateScore() n2 = %d \n", n2.Get64()); //printf(" -- CMasternodePayments CalculateScore() n3 = %d \n", n3.Get64()); //printf(" -- CMasternodePayments CalculateScore() n4 = %d \n", n4.Get64()); - + return n4.Get64(); } @@ -695,6 +695,7 @@ bool CMasternodePayments::AddWinningMasternode(CMasternodePaymentWinner& winnerI winner.vin = winnerIn.vin; winner.payee = winnerIn.payee; winner.vchSig = winnerIn.vchSig; + return true; } } @@ -704,6 +705,7 @@ bool CMasternodePayments::AddWinningMasternode(CMasternodePaymentWinner& winnerI if(!foundBlock){ vWinning.push_back(winnerIn); mapSeenMasternodeVotes.insert(make_pair(winnerIn.GetHash(), winnerIn)); + return true; }