diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index 3d0301f9b..bae043847 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -777,9 +777,13 @@ HASH_AND_TWOINTS(bitcoinrpc,gettxout,txid,vout,mempool) jaddbits256(retjson,"bestblock",coin->blocks.hwmchain.RO.hash2); jaddnum(retjson,"bestheight",coin->blocks.hwmchain.height); jaddnum(retjson,"height",height); + jaddbits256(retjson,"txid",txid); + jaddnum(retjson,"vout",vout); jaddnum(retjson,"confirmations",coin->blocks.hwmchain.height - height + 1); jaddnum(retjson,"value",dstr(value)); jaddnum(retjson,"amount",dstr(value)); + if ( strcmp(coin->symbol,"KMD") == 0 ) + jaddnum(retjson,"interest",dstr(iguana_interest(myinfo,coin,txid,vout,value))); if ( (height % coin->chain->bundlesize) == 0 && vout == 0 ) jadd(retjson,"coinbase",jtrue()); else jadd(retjson,"coinbase",jfalse()); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 5ddad189b..dea1a720c 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -305,6 +305,8 @@ cJSON *iguana_RTunspentjson(struct supernet_info *myinfo,struct iguana_info *coi jaddstr(item,"scriptPubKey",scriptstr); } jaddnum(item,"amount",dstr(value)); + if ( strcmp(coin->symbol,"KMD") == 0 ) + jaddnum(item,"interest",dstr(iguana_interest(myinfo,coin,txid,vout,value))); //jaddnum(item,"timestamp",T[up->txidind].timestamp); if ( iguana_RTunspentindfind(myinfo,coin,&outpt,0,0,0,0,&height,txid,vout,coin->bundlescount-1,0) == 0 ) { diff --git a/iguana/tests/listunspent b/iguana/tests/listunspent index 5e66227ec..bec4770b5 100755 --- a/iguana/tests/listunspent +++ b/iguana/tests/listunspent @@ -1,2 +1,2 @@ #!/bin/bash -curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"KMD\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}" diff --git a/includes/iguana_funcs.h b/includes/iguana_funcs.h index cb70621e1..e3094974e 100755 --- a/includes/iguana_funcs.h +++ b/includes/iguana_funcs.h @@ -434,6 +434,7 @@ cJSON *iguana_RTunspentjson(struct supernet_info *myinfo,struct iguana_info *coi int32_t bitcoin_standardspend(uint8_t *script,int32_t n,uint8_t rmd160[20]); struct iguana_waddress *iguana_waddresssearch(struct supernet_info *myinfo,struct iguana_waccount **wacctp,char *coinaddr); cJSON *iguana_RTlistunspent(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *argarray,int32_t minconf,int32_t maxconf,char *remoteaddr,int32_t includespends); +uint64_t iguana_interest(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout,uint64_t value); void calc_shares(struct supernet_info *myinfo,uint8_t *shares,uint8_t *secret,int32_t size,int32_t width,int32_t M,int32_t N,uint8_t *sharenrs,uint8_t *space,int32_t spacesize); //struct basilisk_spend *basilisk_addspend(struct supernet_info *myinfo,char *symbol,bits256 txid,uint16_t vout,int32_t addflag); //void iguana_wallet_Cclear(struct supernet_info *myinfo,char *symbol);