Add pause if scriptcheckqueue isn't idle
This commit is contained in:
@@ -50,6 +50,8 @@ bool AssetExactAmounts(struct CCcontract_info *cp,int64_t &inputs,int32_t starti
|
||||
int64_t GetAssetBalance(CPubKey pk,uint256 tokenid);
|
||||
int64_t AddAssetInputs(CMutableTransaction &mtx,CPubKey pk,uint256 assetid,int64_t total,int32_t maxinputs);
|
||||
UniValue AssetOrders(uint256 tokenid);
|
||||
UniValue AssetInfo(uint256 tokenid);
|
||||
UniValue AssetList();
|
||||
std::string CreateAsset(int64_t txfee,int64_t assetsupply,std::string name,std::string description);
|
||||
std::string AssetTransfer(int64_t txfee,uint256 assetid,std::vector<uint8_t> destpubkey,int64_t total);
|
||||
std::string CreateBuyOffer(int64_t txfee,int64_t bidamount,uint256 assetid,int64_t pricetotal);
|
||||
|
||||
@@ -57,6 +57,14 @@ int64_t GetAssetBalance(CPubKey pk,uint256 tokenid)
|
||||
return(AddAssetInputs(cp,mtx,pk,tokenid,0,0));
|
||||
}
|
||||
|
||||
UniValue AssetList(uint256 refassetid)
|
||||
{
|
||||
}
|
||||
|
||||
UniValue AssetInfo()
|
||||
{
|
||||
}
|
||||
|
||||
UniValue AssetOrders(uint256 refassetid)
|
||||
{
|
||||
static uint256 zero;
|
||||
|
||||
@@ -2825,6 +2825,14 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
||||
|
||||
CBlockUndo blockundo;
|
||||
|
||||
if ( ASSETCHAINS_CC != 0 )
|
||||
{
|
||||
if ( pqueue->IsIdle() == 0 )
|
||||
{
|
||||
fprintf(stderr,"scriptcheckqueue isnt idle\n");
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
CCheckQueueControl<CScriptCheck> control(fExpensiveChecks && nScriptCheckThreads ? &scriptcheckqueue : NULL);
|
||||
|
||||
int64_t nTimeStart = GetTimeMicros();
|
||||
|
||||
@@ -371,6 +371,8 @@ static const CRPCCommand vRPCCommands[] =
|
||||
{ "dice", "diceaddress", &diceaddress, true },
|
||||
|
||||
/* tokens */
|
||||
{ "tokens", "tokeninfo", &tokeninfo, true },
|
||||
{ "tokens", "tokenlist", &tokenlist, true },
|
||||
{ "tokens", "tokenorders", &tokenorders, true },
|
||||
{ "tokens", "tokenaddress", &tokenaddress, true },
|
||||
{ "tokens", "tokenbalance", &tokenbalance, true },
|
||||
|
||||
@@ -208,6 +208,8 @@ extern UniValue submitblock(const UniValue& params, bool fHelp);
|
||||
extern UniValue estimatefee(const UniValue& params, bool fHelp);
|
||||
extern UniValue estimatepriority(const UniValue& params, bool fHelp);
|
||||
extern UniValue coinsupply(const UniValue& params, bool fHelp);
|
||||
extern UniValue tokeninfo(const UniValue& params, bool fHelp);
|
||||
extern UniValue tokenlist(const UniValue& params, bool fHelp);
|
||||
extern UniValue tokenorders(const UniValue& params, bool fHelp);
|
||||
extern UniValue tokenbalance(const UniValue& params, bool fHelp);
|
||||
extern UniValue tokenaddress(const UniValue& params, bool fHelp);
|
||||
|
||||
@@ -5122,6 +5122,27 @@ UniValue dicebet(const UniValue& params, bool fHelp)
|
||||
return(result);
|
||||
}
|
||||
|
||||
UniValue tokenlist(const UniValue& params, bool fHelp)
|
||||
{
|
||||
uint256 tokenid;
|
||||
if ( fHelp || params.size() > 0 )
|
||||
throw runtime_error("tokenlist\n");
|
||||
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");
|
||||
return(AssetList());
|
||||
}
|
||||
|
||||
UniValue tokeninfo(const UniValue& params, bool fHelp)
|
||||
{
|
||||
uint256 tokenid;
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("tokeninfo tokenid\n");
|
||||
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");
|
||||
tokenid = Parseuint256((char *)params[0].get_str().c_str());
|
||||
return(AssetInfo(tokenid));
|
||||
}
|
||||
|
||||
UniValue tokenorders(const UniValue& params, bool fHelp)
|
||||
{
|
||||
uint256 tokenid;
|
||||
|
||||
Reference in New Issue
Block a user