From 145ea3ec97a3925c9f9a24f004368a9589f240f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 19:17:48 +0300 Subject: [PATCH] Fix portfolio balance calc --- iguana/exchanges/LP_utxo.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index dc4e1e5b2..1ef05630a 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -33,10 +33,14 @@ uint64_t LP_value_extract(cJSON *obj,int32_t addinterest) { - double val = 0.; uint64_t value = 0; - if ( (val= jdouble(obj,"amount")) < SMALLVAL ) - val = jdouble(obj,"value"); - value = (val + 0.0000000049) * SATOSHIDEN; + double val = 0.; uint64_t value = 0; int32_t electrumflag; + electrumflag = (jobj(obj,"tx_hash") != 0); + if ( electrumflag == 0 ) + { + if ( (val= jdouble(obj,"amount")) < SMALLVAL ) + val = jdouble(obj,"value"); + value = (val + 0.0000000049) * SATOSHIDEN; + } else value = j64bits(obj,"value"); if ( value != 0 ) { if ( addinterest != 0 && jobj(obj,"interest") != 0 )