Browse Source

Relay win/loss

pull/4/head
jl777 6 years ago
parent
commit
a88b9554e3
  1. 1
      src/cc/CCinclude.h
  2. 12
      src/cc/dice.cpp

1
src/cc/CCinclude.h

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

12
src/cc/dice.cpp

@ -128,7 +128,17 @@ void *dicefinish(void *_ptr)
if ( duplicate == 0 )
{
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);
return(0);

Loading…
Cancel
Save