X-Git-Url: https://git.novaco.in/?p=NovacoinLibrary.git;a=blobdiff_plain;f=Novacoin%2FStakeModifier.cs;h=67ed568cbc237e4c9b07ffeb31e5f004e37af859;hp=e6b6f50534ea0e94a0665e35381fe3f82a070c9e;hb=ced87004f5e3d01ccb655b690289df227f3f87bf;hpb=b9cd39da5b7744f29c938ec53a99f7595e71c9ad diff --git a/Novacoin/StakeModifier.cs b/Novacoin/StakeModifier.cs index e6b6f50..67ed568 100644 --- a/Novacoin/StakeModifier.cs +++ b/Novacoin/StakeModifier.cs @@ -448,11 +448,16 @@ namespace Novacoin CTransaction txPrev = null; long nBlockPos = 0, nTxPos = 0; - if (!CBlockStore.Instance.GetByTransactionID(txin.prevout.hash, ref block, ref txPrev, ref nBlockPos, ref nTxPos)) + if (!CBlockStore.Instance.GetBlockByTransactionID(txin.prevout.hash, ref block, ref txPrev, ref nBlockPos, ref nTxPos)) { return false; // unable to read block of previous transaction } + if (!ScriptCode.VerifyScript(txin.scriptSig, txPrev.vout[txin.prevout.n].scriptPubKey, tx, 0, (int)scriptflag.SCRIPT_VERIFY_P2SH, 0)) + { + return false; // vin[0] signature check failed + } + if (!CheckStakeKernelHash(nBits, block.header.Hash, block.header.nTime, (uint)(nTxPos - nBlockPos), txPrev, txin.prevout, tx.nTime, ref hashProofOfStake, ref targetProofOfStake)) { return false; // check kernel failed on coinstake