changed vout0 for tokens,

added token opret with non-fungible data
This commit is contained in:
dimxy
2019-02-10 19:37:01 +05:00
parent 175ac9275d
commit 502195f02d

View File

@@ -822,7 +822,8 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
mtx.vin.push_back(CTxIn(gametxid,1+maxplayers+regslot,CScript()));
if ( funcid == 'H' )
mtx.vin.push_back(CTxIn(gametxid,0,CScript()));
mtx.vout.push_back(MakeCC1vout(cp->evalcode,1,mypk));
//mtx.vout.push_back(MakeCC1vout(cp->evalcode,1,mypk));
mtx.vout.push_back(MakeTokensCC1vout(cp->evalcode, 1, mypk));
if ( num > 0 )
{
newdata.resize(num);
@@ -848,7 +849,14 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
mtx.vout.push_back(MakeCC1vout(cp->evalcode,CCchange + (batonvalue-2*txfee),roguepk));
Myprivkey(mypriv);
CCaddr1of2set(cp,roguepk,mypk,mypriv,myrogueaddr);
rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,rogue_highlanderopret(funcid,gametxid,mypk,newdata));
//rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,rogue_highlanderopret(funcid,gametxid,mypk,newdata));
CScript opret = rogue_highlanderopret(funcid, gametxid, mypk, newdata);
std::vector<uint8_t> vopretNonfungible;
GetOpReturnData(opret, vopretNonfungible);
rawtx = FinalizeCCTx(0, cp, mtx, mypk, txfee, EncodeTokenCreateOpRet('c', Mypubkey(), std::string("???"), std::string("??????"), vopretNonfungible));
return(rogue_rawtxresult(result,rawtx,1));
}
result.push_back(Pair("result","success"));