From f7b059addc010997eee9e2e1bc0d281b68eadeec Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Sep 2017 21:51:52 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_socket.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index 4cac73c10..54116d0df 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -306,7 +306,7 @@ struct electrum_info *electrum_server(char *symbol,struct electrum_info *ep) void electrum_process_array(struct iguana_info *coin,cJSON *array) { - int32_t i,n; bits256 txid; cJSON *item; struct LP_transaction *tx; + int32_t i,v,n; char str[65]; uint64_t value; bits256 txid; cJSON *item; struct LP_transaction *tx; if ( array != 0 && coin != 0 && (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; iheight <= 0 ) + if ( tx != 0 ) { - tx->height = jint(item,"height"); - char str[65]; printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); + if (tx->height <= 0 ) + { + tx->height = jint(item,"height"); + printf(">>>>>>>>>> set %s <- height %d\n",bits256_str(str,txid),tx->height); + } + if ( (v= jint(item,"tx_pos")) >= 0 && v < tx->numvouts ) + { + value = j64bits(item,"value"); + if ( 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)); + tx->outpoints[v].value = value; + } + } } } }