diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index b8dc0670b..72e4f96a1 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -436,7 +436,7 @@ char *dpow_alladdresses(struct supernet_info *myinfo,struct iguana_info *coin) char *dpow_importaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address) { - char buf[128],*retstr,*alladdresses,*outstr,fname[1024]; cJSON *alljson; int32_t i,n; FILE *fp; + char buf[1024],*retstr,*alladdresses,*outstr,fname[1024]; cJSON *alljson; int32_t i,n; FILE *fp; if ( coin->FULLNODE < 0 ) { sprintf(buf,"[\"%s\", \"%s\", false]",address,address); @@ -466,6 +466,16 @@ char *dpow_importaddress(struct supernet_info *myinfo,struct iguana_info *coin,c free_json(alljson); } } + else + { + sprintf(buf,"[\"%s\"]",address); + sprintf(fname,"%s/alladdresses.%s",GLOBAL_CONFSDIR,coin->symbol), OS_compatible_path(fname); + if ( (fp= fopen(fname,"wb")) != 0 ) + { + fwrite(buf,1,strlen(buf)+1,fp); + fclose(fp); + } + } return(retstr); } else return(0); diff --git a/iguana/tests/dexalladdresses b/iguana/tests/dexalladdresses new file mode 100755 index 000000000..24feefa9c --- /dev/null +++ b/iguana/tests/dexalladdresses @@ -0,0 +1,2 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"alladdresses\",\"symbol\":\"BTC\"}"