This commit is contained in:
jl777
2019-03-26 06:14:00 -11:00
parent 33ba39090d
commit 3c9b61c105
2 changed files with 8 additions and 8 deletions

View File

@@ -976,7 +976,7 @@ int32_t games_findbaton(struct CCcontract_info *cp,uint256 &playertxid,gameseven
//fprintf(stderr,"n.%d next txid.%s/v%d\n",n,txid.GetHex().c_str(),spentvini);
if ( spentvini != 0 ) // game is over?
{
fprintf(stderr,"gameisover n.%d next txid.%s/v%d\n",n,txid.GetHex().c_str(),spentvini);
//fprintf(stderr,"gameisover n.%d next txid.%s/v%d\n",n,txid.GetHex().c_str(),spentvini);
return(0);
}
if ( keystrokesp != 0 && myGetTransaction(spenttxid,spenttx,hashBlock) != 0 && spenttx.vout.size() >= 2 )
@@ -984,7 +984,7 @@ int32_t games_findbaton(struct CCcontract_info *cp,uint256 &playertxid,gameseven
uint256 g,b; CPubKey p; std::vector<uint8_t> k;
if ( games_keystrokesopretdecode(g,b,p,k,spenttx.vout[spenttx.vout.size()-1].scriptPubKey) == 'K' )
{
fprintf(stderr,"update keystrokes.%p[%d]\n",keystrokes,numkeys);
//fprintf(stderr,"update keystrokes.%p[%d]\n",keystrokes,numkeys);
keystrokes = (gamesevent *)realloc(keystrokes,(int32_t)(sizeof(*keystrokes)*numkeys + k.size()));
for (i=0; i<k.size(); i+=sizeof(gamesevent))
{
@@ -992,11 +992,11 @@ int32_t games_findbaton(struct CCcontract_info *cp,uint256 &playertxid,gameseven
gamesevent val = 0;
for (j=0; j<sizeof(gamesevent); j++)
val = (val << 8) | k[i + sizeof(gamesevent)-1-j];
keystrokes[numkeys+i] = val;
keystrokes[numkeys+i/sizeof(gamesevent)] = val;
}
numkeys += (int32_t)k.size() / sizeof(gamesevent);
(*keystrokesp) = keystrokes;
fprintf(stderr,"updated keystrokes.%p[%d]\n",keystrokes,numkeys);
//fprintf(stderr,"updated keystrokes.%p[%d]\n",keystrokes,numkeys);
}
}
//fprintf(stderr,"n.%d txid.%s\n",n,txid.GetHex().c_str());