X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=4b7bb9a281e785b72d00b66bb434bc17f17ec8b1;hp=660bb4149b119d8e06009e8b972398a52c8be0f1;hb=2d6690cc0c0e2525996856c392566133d1b2de50;hpb=8982b69aabfefd65e8f3d859018228998f523cae diff --git a/src/main.cpp b/src/main.cpp index 660bb41..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