From 579624dcc4d6b1bb727bb73fdf47a70407f7a09d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 1 Nov 2016 14:59:04 -0300 Subject: [PATCH] remove coin made more strict --- iguana/iguana_json.c | 2 ++ iguana/iguana_rpc.c | 2 ++ iguana/main.c | 2 ++ iguana/ramchain_api.c | 1 + includes/iguana_structs.h | 2 +- 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index 59e93d0b8..4b845e0c8 100755 --- a/iguana/iguana_json.c +++ b/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 diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index 95badc29a..718971c06 100755 --- a/iguana/iguana_rpc.c +++ b/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 ) diff --git a/iguana/main.c b/iguana/main.c index c200878fd..157c9aa4b 100755 --- a/iguana/main.c +++ b/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 ) diff --git a/iguana/ramchain_api.c b/iguana/ramchain_api.c index 59fe53824..4231d29bd 100755 --- a/iguana/ramchain_api.c +++ b/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