X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.cpp;h=6df49c7ae7ea141d584aa44797fdffeccca547af;hb=aef688225365ca2a28238926104d98a228acfaa3;hp=70bdce48870bdcc87b33ce0856bd543db486d057;hpb=42c55f2e8a14a2f1c504cfe62e3d1717e8ac5454;p=novacoin.git diff --git a/src/main.cpp b/src/main.cpp index 70bdce4..6df49c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2650,26 +2650,23 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) // ppcoin: check block signature bool CBlock::CheckBlockSignature() const { - if (IsProofOfWork()) - return true; + if (vchBlockSig.empty()) + return false; - vector vSolutions; txnouttype whichType; - - const CTxOut& txout = vtx[1].vout[1]; - - if (!Solver(txout.scriptPubKey, whichType, vSolutions)) + vector vSolutions; + if (!Solver(vtx[1].vout[1].scriptPubKey, whichType, vSolutions)) return false; + if (whichType == TX_PUBKEY) { valtype& vchPubKey = vSolutions[0]; CKey key; if (!key.SetPubKey(vchPubKey)) return false; - if (vchBlockSig.empty()) - return false; return key.Verify(GetHash(), vchBlockSig); } + return false; } @@ -3007,7 +3004,7 @@ bool LoadExternalBlockFile(FILE* fileIn) } } } - catch (std::exception &e) { + catch (const std::exception&) { printf("%s() : Deserialize or I/O error caught during load\n", BOOST_CURRENT_FUNCTION); }