|
|
@ -1348,15 +1348,16 @@ bool CTransaction::HaveInputs(CCoinsViewCache &inputs) const |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool CScriptCheck::operator()() const { |
|
|
|
|
|
|
|
const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; |
|
|
|
|
|
|
|
if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, nHashType)) |
|
|
|
|
|
|
|
return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString().substr(0,10).c_str()); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) |
|
|
|
bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType) |
|
|
|
{ |
|
|
|
{ |
|
|
|
assert(nIn < txTo.vin.size()); |
|
|
|
return CScriptCheck(txFrom, txTo, nIn, flags, nHashType)(); |
|
|
|
const CTxIn& txin = txTo.vin[nIn]; |
|
|
|
|
|
|
|
if (txin.prevout.n >= txFrom.vout.size()) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
const CTxOut& txout = txFrom.vout[txin.prevout.n]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return VerifyScript(txin.scriptSig, txout.scriptPubKey, txTo, nIn, flags, nHashType); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool CTransaction::CheckInputs(CCoinsViewCache &inputs, enum CheckSig_mode csmode, unsigned int flags) const |
|
|
|
bool CTransaction::CheckInputs(CCoinsViewCache &inputs, enum CheckSig_mode csmode, unsigned int flags) const |
|
|
|