This commit is contained in:
jl777
2019-02-11 15:27:49 -11:00
parent 4ceb869bef
commit 5a8b054ede
2 changed files with 5 additions and 4 deletions

View File

@@ -156,7 +156,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
else else
{ {
Getscriptaddress(destaddr,vintx.vout[utxovout].scriptPubKey); Getscriptaddress(destaddr,vintx.vout[utxovout].scriptPubKey);
fprintf(stderr,"FinalizeCCTx() vin.%d is CC %.8f -> (%s) vs %s\n",i,(double)utxovalues[i]/COIN,destaddr,cp->unspendableaddr2); //fprintf(stderr,"FinalizeCCTx() vin.%d is CC %.8f -> (%s) vs %s\n",i,(double)utxovalues[i]/COIN,destaddr,cp->unspendableaddr2);
//std::cerr << "FinalizeCCtx() searching destaddr=" << destaddr << " for vin[" << i << "] satoshis=" << utxovalues[i] << std::endl; //std::cerr << "FinalizeCCtx() searching destaddr=" << destaddr << " for vin[" << i << "] satoshis=" << utxovalues[i] << std::endl;
if( strcmp(destaddr, myaddr) == 0 ) if( strcmp(destaddr, myaddr) == 0 )
{ {
@@ -191,7 +191,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
// check if this is the 2nd additional evalcode + 'unspendable' cc addr: // check if this is the 2nd additional evalcode + 'unspendable' cc addr:
else if ( strcmp(destaddr, cp->unspendableaddr2) == 0) else if ( strcmp(destaddr, cp->unspendableaddr2) == 0)
{ {
fprintf(stderr,"FinalizeCCTx() matched %s unspendable2!\n",cp->unspendableaddr2); //fprintf(stderr,"FinalizeCCTx() matched %s unspendable2!\n",cp->unspendableaddr2);
privkey = cp->unspendablepriv2; privkey = cp->unspendablepriv2;
if( othercond2 == 0 ) if( othercond2 == 0 )
othercond2 = MakeCCcond1(cp->unspendableEvalcode2, cp->unspendablepk2); othercond2 = MakeCCcond1(cp->unspendableEvalcode2, cp->unspendablepk2);

View File

@@ -215,7 +215,7 @@ uint8_t rogue_registeropretdecode(uint256 &gametxid,uint256 &tokenid,uint256 &pl
{ {
std::string name, description; std::vector<uint8_t> vorigPubkey; std::string name, description; std::vector<uint8_t> vorigPubkey;
std::vector<uint8_t> vopretNonfungible, vopret, vopretDummy,origpubkey; std::vector<uint8_t> vopretNonfungible, vopret, vopretDummy,origpubkey;
uint8_t e, f,*script; std::vector<CPubKey> voutPubkeys; uint8_t e, f,*script,flag = 0; std::vector<CPubKey> voutPubkeys;
tokenid = zeroid; tokenid = zeroid;
GetOpReturnData(scriptPubKey, vopret); GetOpReturnData(scriptPubKey, vopret);
script = (uint8_t *)vopret.data(); script = (uint8_t *)vopret.data();
@@ -228,8 +228,9 @@ uint8_t rogue_registeropretdecode(uint256 &gametxid,uint256 &tokenid,uint256 &pl
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;
flag = 1;
} }
if ( vopret.size() > 2 && E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> gametxid; ss >> playertxid) != 0 && e == EVAL_ROGUE && f == 'R' ) if ( vopret.size() > 2 && E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> gametxid; ss >> playertxid) != 0 && e == EVAL_ROGUE && (flag != 0 || f == 'R') )
{ {
return(f); return(f);
} }