added validation for rekt txid
This commit is contained in:
@@ -412,9 +412,14 @@ static bool ValidateFinalTx(struct CCcontract_info *cp, Eval *eval, const CTrans
|
||||
}
|
||||
|
||||
vscript_t opret;
|
||||
if (prices_finalopretdecode(finaltx.vout.back().scriptPubKey, bettxid, pk, lastheight, costbasis, lastprice, liquidationprice, equity, fee) == 0)
|
||||
uint8_t funcId;
|
||||
if ((funcId = prices_finalopretdecode(finaltx.vout.back().scriptPubKey, bettxid, pk, lastheight, costbasis, lastprice, liquidationprice, equity, fee)) == 0)
|
||||
return eval->Invalid("cannot decode opreturn for final tx");
|
||||
|
||||
// check rekt txid mining:
|
||||
if( funcId == 'R' && (finaltx.GetHash().begin()[0] != 0 || finaltx.GetHash().begin()[31] != 0) )
|
||||
return eval->Invalid("incorrect rekt txid");
|
||||
|
||||
if (bettx.GetHash() != bettxid)
|
||||
return eval->Invalid("incorrect bettx id");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user