X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=4b7bb9a281e785b72d00b66bb434bc17f17ec8b1;hp=65001a3c2b6ad0efb766ab0dc3457ba689dd2b07;hb=2d6690cc0c0e2525996856c392566133d1b2de50;hpb=9e58e0a8ca28b15a4bfa677f5b23891972db40fd diff --git a/src/main.cpp b/src/main.cpp index 65001a3..4b7bb9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -445,7 +445,6 @@ CTransaction::GetLegacySigOpCount() const return nSigOps; } - int CMerkleTx::SetMerkleBranch(const CBlock* pblock) { if (fClient) @@ -456,16 +455,6 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock) else { CBlock blockTmp; - if (pblock == NULL) - { - // Load the block this tx is in - CTxIndex txindex; - if (!CTxDB("r").ReadTxIndex(GetHash(), txindex)) - return 0; - if (!blockTmp.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos)) - return 0; - pblock = &blockTmp; - } // Update the tx's hashBlock hashBlock = pblock->GetHash(); @@ -490,19 +479,13 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock) map::iterator mi = mapBlockIndex.find(hashBlock); if (mi == mapBlockIndex.end()) return 0; - CBlockIndex* pindex = (*mi).second; + const CBlockIndex* pindex = (*mi).second; if (!pindex || !pindex->IsInMainChain()) return 0; return pindexBest->nHeight - pindex->nHeight + 1; } - - - - - - bool CTransaction::CheckTransaction() const { // Basic checks that don't depend on any context @@ -3037,7 +3020,7 @@ string GetWarnings(string strFor) strRPC = "test"; // Misc warnings like out of disk space and clock is wrong - if (strMiscWarning != "") + if (!strMiscWarning.empty()) { nPriority = 1000; strStatusBar = strMiscWarning;