Prevent timeout by non-owner
This commit is contained in:
@@ -1475,9 +1475,9 @@ std::string DiceBetFinish(uint8_t &funcid,uint256 &entropyused,int32_t &entropyv
|
|||||||
return("");
|
return("");
|
||||||
}
|
}
|
||||||
fundingpk = DiceFundingPk(fundingPubKey);
|
fundingpk = DiceFundingPk(fundingPubKey);
|
||||||
|
scriptPubKey = CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG;
|
||||||
if ( winlosetimeout != 0 ) // must be dealernode
|
if ( winlosetimeout != 0 ) // must be dealernode
|
||||||
{
|
{
|
||||||
scriptPubKey = CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG;
|
|
||||||
if ( scriptPubKey != fundingPubKey )
|
if ( scriptPubKey != fundingPubKey )
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"only dice fund creator can submit winner or loser\n");
|
//fprintf(stderr,"only dice fund creator can submit winner or loser\n");
|
||||||
@@ -1615,6 +1615,15 @@ std::string DiceBetFinish(uint8_t &funcid,uint256 &entropyused,int32_t &entropyv
|
|||||||
//fprintf(stderr,"make tx.%c\n",funcid);
|
//fprintf(stderr,"make tx.%c\n",funcid);
|
||||||
if ( funcid == 'L' || funcid == 'W' ) // dealernode only
|
if ( funcid == 'L' || funcid == 'W' ) // dealernode only
|
||||||
hentropy = DiceHashEntropy(entropy,mtx.vin[0].prevout.hash,mtx.vin[0].prevout.n,1);
|
hentropy = DiceHashEntropy(entropy,mtx.vin[0].prevout.hash,mtx.vin[0].prevout.n,1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( fundingpk != scriptPubKey && scriptPubKey != betTx.vout[2].scriptPubKey )
|
||||||
|
{
|
||||||
|
CCerror = strprintf("can only finish your own bettxid\n");
|
||||||
|
fprintf(stderr,"%s\n", CCerror.c_str() );
|
||||||
|
return("");
|
||||||
|
}
|
||||||
|
}
|
||||||
*resultp = 1;
|
*resultp = 1;
|
||||||
//char str[65],str2[65];
|
//char str[65],str2[65];
|
||||||
//fprintf(stderr,"iswin.%d house entropy %s vs bettor %s\n",iswin,uint256_str(str,hentropyproof),uint256_str(str2,bettorentropy));
|
//fprintf(stderr,"iswin.%d house entropy %s vs bettor %s\n",iswin,uint256_str(str,hentropyproof),uint256_str(str2,bettorentropy));
|
||||||
@@ -1710,6 +1719,12 @@ double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettx
|
|||||||
GetCCaddress(cp,coinaddr,dicepk);
|
GetCCaddress(cp,coinaddr,dicepk);
|
||||||
if ( bettxid == zeroid ) // scan
|
if ( bettxid == zeroid ) // scan
|
||||||
{
|
{
|
||||||
|
if ( fundingpk != scriptPubkey )
|
||||||
|
{
|
||||||
|
CCerror = "Diceinit error in status, non-dealer must provide bettxid";
|
||||||
|
fprintf(stderr,"%s\n", CCerror.c_str() );
|
||||||
|
return(0.);
|
||||||
|
}
|
||||||
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
|
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
|
||||||
SetCCunspents(unspentOutputs,coinaddr);
|
SetCCunspents(unspentOutputs,coinaddr);
|
||||||
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
||||||
|
|||||||
@@ -3824,7 +3824,7 @@ int32_t komodo_activate_sapling(CBlockIndex *pindex)
|
|||||||
}
|
}
|
||||||
height = pindex->GetHeight();
|
height = pindex->GetHeight();
|
||||||
blocktime = (uint32_t)pindex->nTime;
|
blocktime = (uint32_t)pindex->nTime;
|
||||||
fprintf(stderr,"komodo_activate_sapling.%d starting blocktime %u cmp.%d\n",height,blocktime,blocktime > KOMODO_SAPLING_ACTIVATION);
|
//fprintf(stderr,"komodo_activate_sapling.%d starting blocktime %u cmp.%d\n",height,blocktime,blocktime > KOMODO_SAPLING_ACTIVATION);
|
||||||
|
|
||||||
// avoid trying unless we have at least 30 blocks
|
// avoid trying unless we have at least 30 blocks
|
||||||
if (height < 30)
|
if (height < 30)
|
||||||
|
|||||||
Reference in New Issue
Block a user