Browse Source

remove coin made more strict

olddPoW
jl777 8 years ago
parent
commit
579624dcc4
  1. 2
      iguana/iguana_json.c
  2. 2
      iguana/iguana_rpc.c
  3. 2
      iguana/main.c
  4. 1
      iguana/ramchain_api.c
  5. 2
      includes/iguana_structs.h

2
iguana/iguana_json.c

@ -909,6 +909,8 @@ char *SuperNET_parser(struct supernet_info *myinfo,char *agentstr,char *method,c
coinstr = myinfo->rpcsymbol;
if ( coinstr != 0 && coinstr[0] != 0 )
coin = iguana_coinfind(coinstr);
if ( coin != 0 && coin->removedtime != 0 )
return(clonestr("{\"error\":\"coin is removed\"}"));
if ( strcmp(agentstr,"bitcoinrpc") == 0 && coin == 0 )
return(clonestr("{\"error\":\"bitcoinrpc needs coin that is active\"}"));
#define IGUANA_ARGS myinfo,coin,json,remoteaddr

2
iguana/iguana_rpc.c

@ -34,6 +34,8 @@ char *sglue(GLUEARGS,char *agent,char *method)
jaddstr(json,"coin",coin->symbol);
if ( myinfo->expiration != 0 && time(NULL) > myinfo->expiration )
iguana_walletlock(myinfo,0);
if ( coin->removedtime != 0 )
return(clonestr("{\"error\":\"coin is removed\"}"));
if ( (retstr= SuperNET_JSON(myinfo,coin,json,remoteaddr,port)) != 0 )
{
if ( (retjson= cJSON_Parse(retstr)) != 0 )

2
iguana/main.c

@ -137,6 +137,8 @@ void SuperNET_MYINFOadd(struct supernet_info *myinfo)
char *iguana_JSON(void *_myinfo,void *_coin,char *jsonstr,uint16_t port)
{
char *retstr=0; cJSON *json; struct supernet_info *myinfo = _myinfo; struct iguana_info *coin = _coin;
if ( coin != 0 && coin->removedtime != 0 )
return(clonestr("{\"error\":\"coin is removed\"}"));
if ( (json= cJSON_Parse(jsonstr)) != 0 )
{
if ( myinfo == 0 )

1
iguana/ramchain_api.c

@ -81,6 +81,7 @@ STRING_ARG(iguana,removecoin,activecoin)
{
coin->active = 0;
coin->started = 0;
coin->removedtime = (uint32_t)time(NULL);
if ( 0 )
{
for (i=0; i<IGUANA_MAXPEERS; i++)

2
includes/iguana_structs.h

@ -483,7 +483,7 @@ struct iguana_info
struct OS_memspace RTrawmem,RTmem,RThashmem; // struct iguana_ramchain RTramchain;
bits256 RThash1;
int32_t numremain,numpendings,zcount,recvcount,bcount,pcount,lastbundle,numsaved,pendbalances,numverified,blockdepth,matchedfiles;
uint32_t recvtime,hdrstime,backstoptime,lastbundletime,numreqsent,numbundlesQ,lastbundleitime,lastdisp,RTgenesis,firstRTgenesis,RTstarti,idletime,stucktime,stuckmonitor,maxstuck,lastreqtime,RThdrstime,nextchecked,lastcheckpoint,sigserrs,sigsvalidated,coinid;
uint32_t recvtime,hdrstime,backstoptime,lastbundletime,numreqsent,numbundlesQ,lastbundleitime,lastdisp,RTgenesis,firstRTgenesis,RTstarti,idletime,stucktime,stuckmonitor,maxstuck,lastreqtime,RThdrstime,nextchecked,lastcheckpoint,sigserrs,sigsvalidated,coinid,removedtime;
double bandwidth,maxbandwidth,backstopmillis; bits256 backstophash2; int64_t spaceused;
int32_t disableUTXO,initialheight,mapflags,minconfirms,numrecv,bindsock,isRT,backstop,blocksrecv,merging,firstRTheight,maxRTheight,polltimeout,numreqtxids,allhashes,balanceflush,basilisk_busy,almostRT,busy_processing; bits256 reqtxids[64];
void *launched,*started,*rpcloop;

Loading…
Cancel
Save