Spend right playertxid vout
This commit is contained in:
@@ -225,7 +225,7 @@ uint8_t rogue_registeropretdecode(uint256 &gametxid,uint256 &tokenid,uint256 &pl
|
|||||||
}
|
}
|
||||||
else if ( script[1] != 'R' && (f= DecodeTokenOpRet(scriptPubKey, e, tokenid, voutPubkeys, vopretDummy)) != 0 )
|
else if ( script[1] != 'R' && (f= DecodeTokenOpRet(scriptPubKey, e, tokenid, voutPubkeys, vopretDummy)) != 0 )
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"decode opret %c tokenid.%s\n",script[1],tokenid.GetHex().c_str());
|
fprintf(stderr,"decode opret %c tokenid.%s\n",script[1],tokenid.GetHex().c_str());
|
||||||
GetNonfungibleData(tokenid, vopretNonfungible); //load nonfungible data from the 'tokenbase' tx
|
GetNonfungibleData(tokenid, vopretNonfungible); //load nonfungible data from the 'tokenbase' tx
|
||||||
vopret = vopretNonfungible;
|
vopret = vopretNonfungible;
|
||||||
}
|
}
|
||||||
@@ -747,8 +747,8 @@ UniValue rogue_register(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
|
|||||||
return(cclib_error(result,"couldnt find enough normal funds for buyin"));
|
return(cclib_error(result,"couldnt find enough normal funds for buyin"));
|
||||||
if ( playertxid != zeroid )
|
if ( playertxid != zeroid )
|
||||||
AddNormalinputs2(mtx,txfee,10);
|
AddNormalinputs2(mtx,txfee,10);
|
||||||
if (playertxid != zeroid)
|
if (playertxid != zeroid )
|
||||||
mtx.vin.push_back(CTxIn(playertxid, 1)); // spending cc marker as token is being burned
|
mtx.vin.push_back(CTxIn(playertxid, vout)); // spending cc marker as token is being burned
|
||||||
mtx.vout.push_back(MakeCC1of2vout(cp->evalcode,buyin + inputsum - txfee,roguepk,mypk));
|
mtx.vout.push_back(MakeCC1of2vout(cp->evalcode,buyin + inputsum - txfee,roguepk,mypk));
|
||||||
GetCCaddress1of2(cp,destaddr,roguepk,roguepk);
|
GetCCaddress1of2(cp,destaddr,roguepk,roguepk);
|
||||||
CCaddr1of2set(cp,roguepk,roguepk,cp->CCpriv,destaddr);
|
CCaddr1of2set(cp,roguepk,roguepk,cp->CCpriv,destaddr);
|
||||||
@@ -760,7 +760,7 @@ UniValue rogue_register(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
|
|||||||
{
|
{
|
||||||
//fprintf(stderr,"playertxid.%s\n",playertxid.GetHex().c_str());
|
//fprintf(stderr,"playertxid.%s\n",playertxid.GetHex().c_str());
|
||||||
voutPubkeysEmpty.push_back(burnpk);
|
voutPubkeysEmpty.push_back(burnpk);
|
||||||
if ( GetTransaction(tokenid == zeroid ? playertxid : tokenid,playertx,hashBlock,false) != 0 )
|
if ( GetTransaction(playertxid,playertx,hashBlock,false) != 0 )
|
||||||
{
|
{
|
||||||
if ( (funcid= DecodeTokenOpRet(playertx.vout.back().scriptPubKey, e, tid, voutPubkeys, vopretExtra)) != 0)
|
if ( (funcid= DecodeTokenOpRet(playertx.vout.back().scriptPubKey, e, tid, voutPubkeys, vopretExtra)) != 0)
|
||||||
{ // if token in the opret
|
{ // if token in the opret
|
||||||
|
|||||||
Reference in New Issue
Block a user