jl777 8 years ago
parent
commit
3d61c27619
  1. 14
      iguana/exchanges/LP_socket.c
  2. 4
      iguana/exchanges/LP_utxo.c

14
iguana/exchanges/LP_socket.c

@ -324,19 +324,21 @@ int32_t electrum_process_array(struct iguana_info *coin,char *coinaddr,cJSON *ar
if (tx->height <= 0 ) if (tx->height <= 0 )
{ {
tx->height = jint(item,"height"); tx->height = jint(item,"height");
printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); printf("%s %s >>>>>>>>>> set %s <- height %d\n",coin->symbol,coinaddr,bits256_str(str,txid),tx->height);
} }
if ( jobj(item,"tx_pos") != 0 && jobj(item,"value") != 0 && (v= jint(item,"tx_pos")) >= 0 && v < tx->numvouts )
{
value = j64bits(item,"value"); value = j64bits(item,"value");
v = jint(item,"tx_pos");
if ( jobj(item,"tx_pos") != 0 && jobj(item,"value") != 0 && v >= 0 && v < tx->numvouts )
{
if ( tx->outpoints[v].value == 0 && value != tx->outpoints[v].value ) if ( tx->outpoints[v].value == 0 && value != tx->outpoints[v].value )
{ {
printf(">>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value)); printf("%s %s >>>>>>>>>> set %s/v%d <- %.8f vs %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),v,dstr(value),dstr(tx->outpoints[v].value));
tx->outpoints[v].value = value; tx->outpoints[v].value = value;
flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1);
} }
} }
printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); if ( value != 0 && tx->height > 0 )
flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1);
//printf("v.%d numvouts.%d %.8f (%s)\n",jint(item,"tx_pos"),tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0));
} }
} }
} }

4
iguana/exchanges/LP_utxo.c

@ -163,8 +163,8 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,
portable_mutex_unlock(&coin->addrmutex); portable_mutex_unlock(&coin->addrmutex);
retval = 1; retval = 1;
char str[65]; char str[65];
if ( 0 && height > 0 ) if ( height > 0 )
printf(">>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); printf("ADDRESS_UTXO >>>>>>>>>> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value));
} }
} }
//printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); //printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height);

Loading…
Cancel
Save