Merge pull request #992 from jl777/jl777

Jl777
This commit is contained in:
jl777
2018-11-27 05:05:33 -11:00
committed by GitHub
3 changed files with 19 additions and 4 deletions

View File

@@ -1475,9 +1475,9 @@ std::string DiceBetFinish(uint8_t &funcid,uint256 &entropyused,int32_t &entropyv
return("");
}
fundingpk = DiceFundingPk(fundingPubKey);
scriptPubKey = CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG;
if ( winlosetimeout != 0 ) // must be dealernode
{
scriptPubKey = CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG;
if ( scriptPubKey != fundingPubKey )
{
//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);
if ( funcid == 'L' || funcid == 'W' ) // dealernode only
hentropy = DiceHashEntropy(entropy,mtx.vin[0].prevout.hash,mtx.vin[0].prevout.n,1);
else
{
if ( scriptPubKey != betTx.vout[2].scriptPubKey )
{
CCerror = strprintf("can only finish your own bettxid\n");
fprintf(stderr,"%s\n", CCerror.c_str() );
return("");
}
}
*resultp = 1;
//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));
@@ -1710,6 +1719,12 @@ double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettx
GetCCaddress(cp,coinaddr,dicepk);
if ( bettxid == zeroid ) // scan
{
if ( fundingpk != mypk )
{
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;
SetCCunspents(unspentOutputs,coinaddr);
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)

View File

@@ -1778,7 +1778,7 @@ void komodo_args(char *argv0)
if ( (ASSETCHAINS_LWMAPOS = GetArg("-ac_veruspos",0)) != 0 )
ASSETCHAINS_LWMAPOS = 50;
/*ASSETCHAINS_SAPLING = GetArg("-ac_sapling", -1);
ASSETCHAINS_SAPLING = GetArg("-ac_sapling", -1);
if (ASSETCHAINS_SAPLING == -1)
{
ASSETCHAINS_OVERWINTER = GetArg("-ac_overwinter", -1);
@@ -1786,7 +1786,7 @@ void komodo_args(char *argv0)
else
{
ASSETCHAINS_OVERWINTER = GetArg("-ac_overwinter", ASSETCHAINS_SAPLING);
}*/
}
if ( strlen(ASSETCHAINS_OVERRIDE_PUBKEY.c_str()) == 66 || ASSETCHAINS_SCRIPTPUB.size() > 1 )
{
if ( strlen(ASSETCHAINS_OVERRIDE_PUBKEY.c_str()) == 66 )

View File

@@ -3824,7 +3824,7 @@ int32_t komodo_activate_sapling(CBlockIndex *pindex)
}
height = pindex->GetHeight();
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
if (height < 30)