Iterate dicewinner/loser
This commit is contained in:
@@ -119,24 +119,34 @@ void *dicefinish(void *_ptr)
|
|||||||
if ( duplicate == 0 )
|
if ( duplicate == 0 )
|
||||||
{
|
{
|
||||||
CTransaction tx; uint256 txid; char str[65]; int32_t result;
|
CTransaction tx; uint256 txid; char str[65]; int32_t result;
|
||||||
res = DiceWinLoseTimeout(&result,0,name,ptr->fundingtxid,ptr->bettxid,ptr->iswin);
|
for (i=0; i<10; i++)
|
||||||
if ( result != 0 && res.empty() == 0 && res.size() > 64 && is_hexstr((char *)res.c_str(),0) > 64 )
|
|
||||||
{
|
{
|
||||||
//LOCK(cs_main);
|
res = DiceWinLoseTimeout(&result,0,name,ptr->fundingtxid,ptr->bettxid,ptr->iswin);
|
||||||
if ( DecodeHexTx(tx,res) != 0 )
|
if ( result != 0 && res.empty() == 0 && res.size() > 64 && is_hexstr((char *)res.c_str(),0) > 64 )
|
||||||
{
|
{
|
||||||
txid = tx.GetHash();
|
//LOCK(cs_main);
|
||||||
fprintf(stderr,"%s\nresult.(%s)\n",res.c_str(),uint256_str(str,txid));
|
if ( DecodeHexTx(tx,res) != 0 )
|
||||||
for (i=0; i<10; i++)
|
|
||||||
{
|
{
|
||||||
|
txid = tx.GetHash();
|
||||||
|
fprintf(stderr,"iter.%d %s\nresult.(%s)\n",i,res.c_str(),uint256_str(str,txid));
|
||||||
if ( myAddtomempool(tx) == 0 )
|
if ( myAddtomempool(tx) == 0 )
|
||||||
{
|
{
|
||||||
RelayTransaction(tx);
|
RelayTransaction(tx);
|
||||||
fprintf(stderr,"Relay transaction\n");
|
fprintf(stderr,"Relay transaction\n");
|
||||||
sleep(1);
|
if ( myAddtomempool(tx) != 0 )
|
||||||
} else break;
|
{
|
||||||
|
fprintf(stderr,"result tx in mempool\n",uint256_str(str,txid));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr,"result tx in mempool\n",uint256_str(str,txid));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} else fprintf(stderr,"error decoding result tx\n");
|
||||||
|
sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(ptr);
|
free(ptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user