diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index 8a950eef2..632fef536 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -603,7 +603,7 @@ STRING_ARG(iguana,getconnectioncount,activecoin) ZERO_ARGS(bitcoinrpc,getdifficulty) { - char buf[64]; + char buf[512]; if ( coin != 0 ) { /* { @@ -611,7 +611,7 @@ ZERO_ARGS(bitcoinrpc,getdifficulty) "proof-of-stake": 0.00112314, "search-interval": 0 }*/ - sprintf(buf,"{\"result\":\"%.8f\"}",PoW_from_compact(coin->blocks.hwmchain.RO.bits,coin->chain->unitval)); + sprintf(buf,"{\"result\":\"success\",\"proof-of-work\":\"%.8f\",\"search-interval\": 0}",PoW_from_compact(coin->blocks.hwmchain.RO.bits,coin->chain->unitval)); return(clonestr(buf)); } else return(clonestr("{\"error\":\"getdifficulty needs coin\"}")); } diff --git a/iguana/tests/arraytest b/iguana/tests/arraytest new file mode 100755 index 000000000..4191fd1cf --- /dev/null +++ b/iguana/tests/arraytest @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "[{\"agent\":\"SuperNET\",\"method\":\"activehandle\"}, {\"agent\":\"bitcoinrpc\",\"activecoin\":\"BTCD\",\"method\":\"getdifficulty\"}]"