From 50d253a08f504818b1ed2f2dd85fc3e533df24b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 26 Oct 2017 18:59:40 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_signatures.c | 9 +++++++-- iguana/exchanges/LP_statemachine.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index a53c1ef6e..7a94a08c6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -271,10 +271,11 @@ bits256 LP_utxos_sighash(uint32_t timestamp,uint8_t *pubsecp,bits256 pubkey,bits int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits256 pubkey,bits256 utxoshash) { - static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; char str[65]; + static void *ctx; int32_t retval=-1; uint8_t pub33[33],pubsecp[33],sig[65]; bits256 sighash; char str[65]; struct LP_pubkeyinfo *pubp; if ( ctx == 0 ) ctx = bitcoin_ctx(); - if ( sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) + pubp = LP_pubkeyfind(pubkey); + if ( pubp->numerrors < LP_MAXPUBKEY_ERRORS && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 ) { decode_hex(sig,65,sigstr); decode_hex(pubsecp,33,pubsecpstr); @@ -284,7 +285,11 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2 { static uint32_t counter; if ( counter++ < 100 ) + { + if ( pubp != 0 ) + pubp->numerrors++; printf("LP_utxos_sigcheck failure, probably from %s with older version\n",bits256_str(str,pubkey)); + } retval = -1; } else retval = 0; } diff --git a/iguana/exchanges/LP_statemachine.c b/iguana/exchanges/LP_statemachine.c index b84c79843..61396e280 100644 --- a/iguana/exchanges/LP_statemachine.c +++ b/iguana/exchanges/LP_statemachine.c @@ -2305,7 +2305,7 @@ struct LP_utxoinfo *LP_bestutxo(double *ordermatchpricep,int64_t *bestsatoshisp, { numrestraints++; butxo->T.bestflag = 0; - pubp->numerrors = 0; + //pubp->numerrors = 0; } } }