X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fscript.cpp;h=c97c8946a72d70f6004b7974d946229dab1714aa;hb=e10fa48ea2c24f9647668aafa1f9caa48a51de2f;hp=e8bfab53cf1c48e053f3be070cfb8fba5e65ef74;hpb=c69eb1bd70e0dc94095d63b0de50dc8d2910ea0e;p=novacoin.git diff --git a/src/script.cpp b/src/script.cpp index e8bfab5..c97c894 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -294,7 +294,7 @@ bool IsDERSignature(const valtype &vchSig, bool fWithHashType, bool fCheckLow) { if (5 + nLenR >= vchSig.size()) return error("Non-canonical signature: S length misplaced"); unsigned int nLenS = vchSig[5+nLenR]; - if ((unsigned long)(nLenR + nLenS + (fWithHashType ? 7 : 6)) != vchSig.size()) + if ((nLenR + nLenS + (fWithHashType ? 7 : 6)) != vchSig.size()) return error("Non-canonical signature: R+S length mismatch"); const unsigned char *R = &vchSig[4]; @@ -1195,7 +1195,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector SMALLDATA_SWITCH_TIME) + if (fTestNet || GetTime() > SMALLDATA_SWITCH_TIME) { // Malleable pubkey tx hack, sender provides generated pubkey combined with R parameter. The R parameter is dropped before checking a signature. mTemplates.insert(make_pair(TX_PUBKEY_DROP, CScript() << OP_PUBKEY << OP_PUBKEY << OP_DROP << OP_CHECKSIG)); @@ -1618,8 +1618,11 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto vector vSolutions; if (!Solver(scriptPubKey, typeRet, vSolutions)) return false; - if (typeRet == TX_NULL_DATA || typeRet == TX_PUBKEY_DROP) + if (typeRet == TX_NULL_DATA) + { + nRequiredRet = 0; return true; + } if (typeRet == TX_MULTISIG) { @@ -1633,6 +1636,8 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto else { nRequiredRet = 1; + if (typeRet == TX_PUBKEY_DROP) + return true; CTxDestination address; if (!ExtractDestination(scriptPubKey, address)) return false;