From edbfcf7dcbcba3d518541424fcbf9857b6a416a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Mar 2017 19:10:29 +0200 Subject: [PATCH] Test --- basilisk/basilisk_bitcoin.c | 5 ++++- basilisk/basilisk_swap.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/basilisk/basilisk_bitcoin.c b/basilisk/basilisk_bitcoin.c index 9f1417484..3a174e3ac 100755 --- a/basilisk/basilisk_bitcoin.c +++ b/basilisk/basilisk_bitcoin.c @@ -806,8 +806,11 @@ char *basilisk_bitcoinrawtx(struct supernet_info *myinfo,struct iguana_info *coi if ( txfee == 0 ) { txfee = iguana_esttxfee(myinfo,coin,rawtx,0,vins != 0 ? cJSON_GetArraySize(vins): 0); + free(rawtx); + if ( vins != 0 ) + free_json(vins), vins = 0; rawtx = iguana_calcrawtx(myinfo,coin,&vins,txobj,amount,changeaddr,txfee,addresses,minconf,oplen!=0?buf:0,oplen+offset,burnamount,remoteaddr,V,0); - printf("new txfee %.8f\n",dstr(txfee)); + printf("new txfee %.8f (%s)\n",dstr(txfee),rawtx); } //printf("generated.(%s) vins.(%s)\n",rawtx!=0?rawtx:"",vins!=0?jprint(vins,0):""); } diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index 32b1c8144..0aada0ba4 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -522,7 +522,7 @@ int32_t basilisk_rawtx_gen(char *str,struct supernet_info *myinfo,uint32_t swaps V = calloc(256,sizeof(*V)); if ( (retstr= basilisk_bitcoinrawtx(myinfo,rawtx->coin,"",basilisktag,jint(valsobj,"timeout"),valsobj,V)) != 0 ) { - //printf("%s %s basilisk_bitcoinrawtx.(%s)\n",rawtx->name,str,retstr); + printf("%s %s basilisk_bitcoinrawtx.(%s)\n",rawtx->name,str,retstr); flag = 0; if ( (retarray= cJSON_Parse(retstr)) != 0 ) {