jumblr_pause and jumblr_resume
Thanks to @amigo for the feature request
This commit is contained in:
@@ -44,7 +44,7 @@ struct komodo_state KOMODO_STATES[34];
|
|||||||
int COINBASE_MATURITY = _COINBASE_MATURITY;//100;
|
int COINBASE_MATURITY = _COINBASE_MATURITY;//100;
|
||||||
|
|
||||||
int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND;
|
int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND;
|
||||||
int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED;
|
int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE;
|
||||||
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES;
|
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES;
|
||||||
uint8_t NOTARY_PUBKEY33[33];
|
uint8_t NOTARY_PUBKEY33[33];
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ uint64_t komodo_moneysupply(int32_t height)
|
|||||||
uint64_t _komodo_interestnew(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
|
uint64_t _komodo_interestnew(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
|
||||||
{
|
{
|
||||||
int32_t minutes; uint64_t interest = 0;
|
int32_t minutes; uint64_t interest = 0;
|
||||||
if ( (minutes= (tiptime - nLockTime) / 60) >= 60 )
|
if ( tiptime > nLockTime && (minutes= (tiptime - nLockTime) / 60) >= 60 )
|
||||||
{
|
{
|
||||||
if ( minutes > 365 * 24 * 60 )
|
if ( minutes > 365 * 24 * 60 )
|
||||||
minutes = 365 * 24 * 60;
|
minutes = 365 * 24 * 60;
|
||||||
|
|||||||
@@ -630,6 +630,8 @@ void jumblr_iteration()
|
|||||||
{
|
{
|
||||||
static int32_t lastheight; static uint32_t lasttime;
|
static int32_t lastheight; static uint32_t lasttime;
|
||||||
char *zaddr,*addr,*retstr,secretaddr[64]; cJSON *array; int32_t i,iter,height,counter,chosen_one,n; uint64_t smallest,medium,biggest,amount=0,total=0; double fee; struct jumblr_item *ptr,*tmp; uint16_t r,s;
|
char *zaddr,*addr,*retstr,secretaddr[64]; cJSON *array; int32_t i,iter,height,counter,chosen_one,n; uint64_t smallest,medium,biggest,amount=0,total=0; double fee; struct jumblr_item *ptr,*tmp; uint16_t r,s;
|
||||||
|
if ( JUMBLR_PAUSE != 0 )
|
||||||
|
return;
|
||||||
if ( lasttime == 0 )
|
if ( lasttime == 0 )
|
||||||
{
|
{
|
||||||
if ( (retstr= jumblr_zlistaddresses()) != 0 )
|
if ( (retstr= jumblr_zlistaddresses()) != 0 )
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ uint64_t komodo_interestsum();
|
|||||||
int32_t komodo_longestchain();
|
int32_t komodo_longestchain();
|
||||||
int32_t komodo_notarized_height(uint256 *hashp,uint256 *txidp);
|
int32_t komodo_notarized_height(uint256 *hashp,uint256 *txidp);
|
||||||
int32_t komodo_whoami(char *pubkeystr,int32_t height);
|
int32_t komodo_whoami(char *pubkeystr,int32_t height);
|
||||||
extern int32_t KOMODO_LASTMINED;
|
extern int32_t KOMODO_LASTMINED,JUMBLR_PAUSE;
|
||||||
extern char ASSETCHAINS_SYMBOL[];
|
extern char ASSETCHAINS_SYMBOL[];
|
||||||
int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heightp);
|
int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heightp);
|
||||||
#define KOMODO_VERSION "0.1.1"
|
#define KOMODO_VERSION "0.1.1"
|
||||||
@@ -224,6 +224,26 @@ UniValue jumblr_secret(const UniValue& params, bool fHelp)
|
|||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UniValue jumblr_pause(const UniValue& params, bool fHelp)
|
||||||
|
{
|
||||||
|
int32_t retval; UniValue result(UniValue::VOBJ);
|
||||||
|
if (fHelp )
|
||||||
|
throw runtime_error("jumblr_pause\n");
|
||||||
|
JUMBLR_PAUSE = 1;
|
||||||
|
result.push_back(Pair("result", "paused"));
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
UniValue jumblr_resume(const UniValue& params, bool fHelp)
|
||||||
|
{
|
||||||
|
int32_t retval; UniValue result(UniValue::VOBJ);
|
||||||
|
if (fHelp )
|
||||||
|
throw runtime_error("jumblr_resume\n");
|
||||||
|
JUMBLR_PAUSE = 0;
|
||||||
|
result.push_back(Pair("result", "resumed"));
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
||||||
UniValue validateaddress(const UniValue& params, bool fHelp)
|
UniValue validateaddress(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
|
|||||||
@@ -338,6 +338,8 @@ static const CRPCCommand vRPCCommands[] =
|
|||||||
{ "util", "z_validateaddress", &z_validateaddress, true }, /* uses wallet if enabled */
|
{ "util", "z_validateaddress", &z_validateaddress, true }, /* uses wallet if enabled */
|
||||||
{ "util", "jumblr_deposit", &jumblr_deposit, true },
|
{ "util", "jumblr_deposit", &jumblr_deposit, true },
|
||||||
{ "util", "jumblr_secret", &jumblr_secret, true },
|
{ "util", "jumblr_secret", &jumblr_secret, true },
|
||||||
|
{ "util", "jumblr_pause", &jumblr_pause, true },
|
||||||
|
{ "util", "jumblr_resume", &jumblr_resume, true },
|
||||||
|
|
||||||
/* Not shown in help */
|
/* Not shown in help */
|
||||||
{ "hidden", "invalidateblock", &invalidateblock, true },
|
{ "hidden", "invalidateblock", &invalidateblock, true },
|
||||||
|
|||||||
@@ -248,6 +248,8 @@ extern UniValue zc_sample_joinsplit(const UniValue& params, bool fHelp);
|
|||||||
|
|
||||||
extern UniValue jumblr_deposit(const UniValue& params, bool fHelp);
|
extern UniValue jumblr_deposit(const UniValue& params, bool fHelp);
|
||||||
extern UniValue jumblr_secret(const UniValue& params, bool fHelp);
|
extern UniValue jumblr_secret(const UniValue& params, bool fHelp);
|
||||||
|
extern UniValue jumblr_pause(const UniValue& params, bool fHelp);
|
||||||
|
extern UniValue jumblr_resume(const UniValue& params, bool fHelp);
|
||||||
|
|
||||||
extern UniValue getrawtransaction(const UniValue& params, bool fHelp); // in rcprawtransaction.cpp
|
extern UniValue getrawtransaction(const UniValue& params, bool fHelp); // in rcprawtransaction.cpp
|
||||||
extern UniValue listunspent(const UniValue& params, bool fHelp);
|
extern UniValue listunspent(const UniValue& params, bool fHelp);
|
||||||
|
|||||||
Reference in New Issue
Block a user