From fb26682b21958f903d636db072e5fc720804f128 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Nov 2017 22:25:12 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_include.h | 3 +-- iguana/exchanges/LP_zeroconf.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 8eb56d467..04261a769 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -322,7 +322,7 @@ struct LP_address UT_hash_handle hh; struct LP_address_utxo *utxos; bits256 pubkey; - int64_t balance,total; + int64_t balance,total,zeroconf_credits; uint32_t timestamp,n,unspenttime; int32_t unspentheight; char coinaddr[40]; @@ -398,7 +398,6 @@ struct LP_pubkey_info bits256 pubkey; struct LP_pubkey_quote *quotes; struct LP_pubswap *bobswaps,*aliceswaps; - uint64_t bondvalue,swaps_kmdvalue; uint32_t timestamp,numerrors,lasttime; int32_t istrusted; uint8_t rmd160[20],sig[65],pubsecp[33],siglen; diff --git a/iguana/exchanges/LP_zeroconf.c b/iguana/exchanges/LP_zeroconf.c index e44934c79..f47e67633 100644 --- a/iguana/exchanges/LP_zeroconf.c +++ b/iguana/exchanges/LP_zeroconf.c @@ -192,9 +192,16 @@ char *LP_zeroconf_claim(struct iguana_info *coin,char *depositaddr,uint32_t expi void LP_zeroconf_credit(char *coinaddr,uint64_t satoshis,int32_t weeki,char *p2shaddr) { - uint32_t timestamp; - timestamp = LP_FIRSTWEEKTIME + weeki*LP_WEEKMULT; - printf("ZEROCONF credit.(%s) %.8f weeki.%d (%s)\n",coinaddr,dstr(satoshis),weeki,p2shaddr); + uint32_t timestamp; struct LP_address *ap; struct iguana_info *coin = LP_coinfind("KMD"); + if ( coin != 0 ) + { + timestamp = LP_FIRSTWEEKTIME + weeki*LP_WEEKMULT; + if ( (ap= LP_address(coin,coinaddr)) != 0 ) + { + ap->zeroconf_credits += satoshis; + printf("ZEROCONF credit.(%s) %.8f weeki.%d (%s) -> sum %.8f\n",coinaddr,dstr(satoshis),weeki,p2shaddr,dstr(ap->zeroconf_credits)); + } + } } void LP_zeroconf_deposits(struct iguana_info *coin)