Test
This commit is contained in:
@@ -241,21 +241,24 @@ int32_t dicefinish_utxosget(int32_t &total,struct dicefinish_utxo *utxos,int32_t
|
|||||||
total = 0;
|
total = 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++)
|
|
||||||
{
|
{
|
||||||
if ( myIsutxo_spentinmempool(it->first.txhash,(int32_t)it->first.index) == 0 )
|
LOCK(mempool.cs);
|
||||||
|
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
||||||
{
|
{
|
||||||
if ( it->second.satoshis < threshold || it->second.satoshis > 10*threshold )
|
if ( myIsutxo_spentinmempool(it->first.txhash,(int32_t)it->first.index) == 0 )
|
||||||
continue;
|
|
||||||
total++;
|
|
||||||
if ( n < max )
|
|
||||||
{
|
{
|
||||||
if ( utxos != 0 )
|
if ( it->second.satoshis < threshold || it->second.satoshis > 10*threshold )
|
||||||
|
continue;
|
||||||
|
total++;
|
||||||
|
if ( n < max )
|
||||||
{
|
{
|
||||||
utxos[n].txid = it->first.txhash;
|
if ( utxos != 0 )
|
||||||
utxos[n].vout = (int32_t)it->first.index;
|
{
|
||||||
|
utxos[n].txid = it->first.txhash;
|
||||||
|
utxos[n].vout = (int32_t)it->first.index;
|
||||||
|
}
|
||||||
|
n++;
|
||||||
}
|
}
|
||||||
n++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -284,6 +287,7 @@ int32_t dice_betspent(char *debugstr,uint256 bettxid)
|
|||||||
}
|
}
|
||||||
else*/
|
else*/
|
||||||
{
|
{
|
||||||
|
LOCK(mempool.cs);
|
||||||
if ( myIsutxo_spentinmempool(bettxid,0) != 0 || myIsutxo_spentinmempool(bettxid,1) != 0 )
|
if ( myIsutxo_spentinmempool(bettxid,0) != 0 || myIsutxo_spentinmempool(bettxid,1) != 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"%s bettxid.%s already spent in mempool\n",debugstr,bettxid.GetHex().c_str());
|
fprintf(stderr,"%s bettxid.%s already spent in mempool\n",debugstr,bettxid.GetHex().c_str());
|
||||||
|
|||||||
@@ -6188,6 +6188,7 @@ UniValue dicefinish(const UniValue& params, bool fHelp)
|
|||||||
if ( ensure_CCrequirements() < 0 )
|
if ( ensure_CCrequirements() < 0 )
|
||||||
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
||||||
const CKeyStore& keystore = *pwalletMain;
|
const CKeyStore& keystore = *pwalletMain;
|
||||||
|
LOCK(mempool.cs);
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
name = (char *)params[0].get_str().c_str();
|
name = (char *)params[0].get_str().c_str();
|
||||||
if (!VALID_PLAN_NAME(name)) {
|
if (!VALID_PLAN_NAME(name)) {
|
||||||
@@ -6223,6 +6224,7 @@ UniValue dicestatus(const UniValue& params, bool fHelp)
|
|||||||
if ( ensure_CCrequirements() < 0 )
|
if ( ensure_CCrequirements() < 0 )
|
||||||
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
||||||
const CKeyStore& keystore = *pwalletMain;
|
const CKeyStore& keystore = *pwalletMain;
|
||||||
|
LOCK(mempool.cs);
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
name = (char *)params[0].get_str().c_str();
|
name = (char *)params[0].get_str().c_str();
|
||||||
if (!VALID_PLAN_NAME(name)) {
|
if (!VALID_PLAN_NAME(name)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user