Browse Source

filter unspendables from listunspent

etomic
jl777 8 years ago
parent
commit
5552f9fb5a
  1. 2
      iguana/dpow/dpow_rpc.c
  2. 2
      iguana/iguana_unspents.c

2
iguana/dpow/dpow_rpc.c

@ -560,6 +560,8 @@ int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits
{ {
i = (r + j) % n; i = (r + j) % n;
item = jitem(unspents,i); item = jitem(unspents,i);
if ( is_cJSON_False(jobj(item,"spendable")) != 0 )
continue;
satoshis = SATOSHIDEN * jdouble(item,"amount"); satoshis = SATOSHIDEN * jdouble(item,"amount");
if ( satoshis == DPOW_UTXOSIZE && (address= jstr(item,"address")) != 0 && strcmp(address,coinaddr) == 0 ) if ( satoshis == DPOW_UTXOSIZE && (address= jstr(item,"address")) != 0 && strcmp(address,coinaddr) == 0 )
{ {

2
iguana/iguana_unspents.c

@ -1220,6 +1220,8 @@ int32_t iguana_RTunspentslists(struct supernet_info *myinfo,struct iguana_info *
{ {
for (i=0; i<n; i++) for (i=0; i<n; i++)
{ {
if ( is_cJSON_False(jobj(item,"spendable")) != 0 )
continue;
item = jitem(array,i); item = jitem(array,i);
if ( (spendscriptstr= jstr(item,"scriptPubKey")) == 0 ) if ( (spendscriptstr= jstr(item,"scriptPubKey")) == 0 )
{ {

Loading…
Cancel
Save