Relay win/loss

This commit is contained in:
jl777
2018-07-31 04:58:22 -11:00
parent e787eaee4b
commit a88b9554e3
2 changed files with 12 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ bool GetAddressUnspent(uint160 addressHash, int type,std::vector<std::pair<CAddr
static const uint256 zeroid; static const uint256 zeroid;
bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock); bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock);
int32_t is_hexstr(char *str,int32_t n);
// CCcustom // CCcustom
CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv); CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv);

View File

@@ -128,7 +128,17 @@ void *dicefinish(void *_ptr)
if ( duplicate == 0 ) if ( duplicate == 0 )
{ {
res = DiceWinLoseTimeout(0,name,ptr->fundingtxid,ptr->bettxid,ptr->iswin); res = DiceWinLoseTimeout(0,name,ptr->fundingtxid,ptr->bettxid,ptr->iswin);
fprintf(stderr,"result.(%s)\n",res.c_str()); if ( is_hexstr((char *)res.c_str(),0) > 64 )
{
CTransaction tx; uint256 txid; char str[65];
LOCK(cs_main);
if ( DecodeHexTx(tx,res) != 0 )
{
txid = tx.GetHash();
RelayTransaction(tx);
fprintf(stderr,"result.(%s)\n",uint256_str(str,txid));
}
} else fprintf(stderr,"result.(%s)\n",res.c_str());
} }
free(ptr); free(ptr);
return(0); return(0);