diff --git a/src/darksend.cpp b/src/darksend.cpp index 53d1c98abe..0ad9b1747e 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1292,33 +1292,6 @@ bool CDarkSendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod return true; } -bool CDarkSendPool::GetBlockHash(uint256& hash, int nBlockHeight) -{ - if(unitTest){ - hash.SetHex("00000000001432b4910722303bff579d0445fa23325bdc34538bdb226718ba79"); - return true; - } - - const CBlockIndex *BlockLastSolved = chainActive.Tip(); - const CBlockIndex *BlockReading = chainActive.Tip(); - - if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0) { return false; } - - //printf(" nBlockHeight2 %d %d\n", nBlockHeight, chainActive.Tip()->nHeight+1); - - for (unsigned int i = 1; BlockReading && BlockReading->nHeight > 0; i++) { - if(BlockReading->nHeight == nBlockHeight) { - hash = BlockReading->GetBlockHash(); - return true; - } - - if (BlockReading->pprev == NULL) { assert(BlockReading); break; } - BlockReading = BlockReading->pprev; - } - - return false; -} - void CDarkSendPool::NewBlock() { if(fDebug) LogPrintf("CDarkSendPool::NewBlock \n"); diff --git a/src/darksend.h b/src/darksend.h index 0bd3d2ab79..85829e42d5 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -407,8 +407,6 @@ public: // as a client, check and sign the final transaction bool SignFinalTransaction(CTransaction& finalTransactionNew, CNode* node); - // get block hash by height - bool GetBlockHash(uint256& hash, int nBlockHeight); // get the last valid block hash for a given modulus bool GetLastValidBlockHash(uint256& hash, int mod=1, int nBlockHeight=0); // process a new block diff --git a/src/masternode.cpp b/src/masternode.cpp index 540d693cdd..d4a7206709 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -680,7 +680,7 @@ bool CMasternodePayments::GetWinningMasternode(int nBlockHeight, CTxIn& vinOut) bool CMasternodePayments::AddWinningMasternode(CMasternodePaymentWinner& winnerIn) { uint256 blockHash = 0; - if(!darkSendPool.GetBlockHash(blockHash, winnerIn.nBlockHeight-576)) { + if(!GetBlockHash(blockHash, winnerIn.nBlockHeight-576)) { return false; }