Check 'c' for valid player data

This commit is contained in:
jl777
2019-03-03 06:02:51 -11:00
parent 70ac45748f
commit bbc9c187fb

View File

@@ -1517,7 +1517,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
return(true); return(true);
break; break;
case 'H': case 'Q': case 'H': case 'Q':
if ( (f= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) != funcid ) /*if ( (f= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) != funcid )
{ {
//fprintf(stderr,"height.%d couldnt decode H/Q opret\n",height); //fprintf(stderr,"height.%d couldnt decode H/Q opret\n",height);
//if ( height > 20000 ) //if ( height > 20000 )
@@ -1525,7 +1525,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
} }
fprintf(stderr,"height.%d decoded H/Q opret\n",height); fprintf(stderr,"height.%d decoded H/Q opret\n",height);
// spending the baton proves it is the user if the pk is the signer // spending the baton proves it is the user if the pk is the signer
// rest of validation is done below // rest of validation is done below*/
break; break;
default: default:
return eval->Invalid("illegal rogue non-decoded funcid"); return eval->Invalid("illegal rogue non-decoded funcid");
@@ -1546,7 +1546,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
return eval->Invalid("couldnt decode H/Q opret"); return eval->Invalid("couldnt decode H/Q opret");
} }
// verify pk belongs to this tx // verify pk belongs to this tx
if ( tokentx != 'c' && playerdata.size() > 0 ) if ( tokentx == 'c' && playerdata.size() > 0 )
{ {
static char laststr[512]; char cashstr[512]; static char laststr[512]; char cashstr[512];
if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 )