Simpler internal check
This commit is contained in:
@@ -138,7 +138,6 @@ bool ValidateStakeTransaction(const CTransaction &stakeTx, CStakeParams &stakePa
|
|||||||
|
|
||||||
// a valid stake transaction has one input and two outputs, one output is the monetary value and one is an op_ret with CStakeParams
|
// a valid stake transaction has one input and two outputs, one output is the monetary value and one is an op_ret with CStakeParams
|
||||||
// stake output #1 must be P2PK or P2PKH, unless a delegate for the coinbase is specified
|
// stake output #1 must be P2PK or P2PKH, unless a delegate for the coinbase is specified
|
||||||
|
|
||||||
if (GetStakeParams(stakeTx, stakeParams))
|
if (GetStakeParams(stakeTx, stakeParams))
|
||||||
{
|
{
|
||||||
// if we have gotten this far and are still valid, we need to validate everything else
|
// if we have gotten this far and are still valid, we need to validate everything else
|
||||||
@@ -168,7 +167,7 @@ bool ValidateStakeTransaction(const CTransaction &stakeTx, CStakeParams &stakePa
|
|||||||
if (!validateSig || VerifyScript(stakeTx.vin[0].scriptSig,
|
if (!validateSig || VerifyScript(stakeTx.vin[0].scriptSig,
|
||||||
srcTx.vout[stakeTx.vin[0].prevout.n].scriptPubKey,
|
srcTx.vout[stakeTx.vin[0].prevout.n].scriptPubKey,
|
||||||
MANDATORY_SCRIPT_VERIFY_FLAGS,
|
MANDATORY_SCRIPT_VERIFY_FLAGS,
|
||||||
ServerTransactionSignatureChecker(&stakeTx, (uint32_t)0, srcTx.vout[stakeTx.vin[0].prevout.n].nValue, false),
|
TransactionSignatureChecker(&stakeTx, (uint32_t)0, srcTx.vout[stakeTx.vin[0].prevout.n].nValue),
|
||||||
consensusBranchId))
|
consensusBranchId))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1641,6 +1641,7 @@ bool verusCheckPOSBlock(int32_t slowflag, CBlock *pblock, int32_t height)
|
|||||||
// allow delegation of stake, but require all ouputs to be
|
// allow delegation of stake, but require all ouputs to be
|
||||||
// crypto conditions
|
// crypto conditions
|
||||||
CStakeParams p;
|
CStakeParams p;
|
||||||
|
|
||||||
// validatestake transaction sets the pubkey of the stake output
|
// validatestake transaction sets the pubkey of the stake output
|
||||||
// if it has no override into the pubkey
|
// if it has no override into the pubkey
|
||||||
if (ValidateStakeTransaction(pblock->vtx[txn_count-1], p, false))
|
if (ValidateStakeTransaction(pblock->vtx[txn_count-1], p, false))
|
||||||
|
|||||||
Reference in New Issue
Block a user