From 85d01b1afb8800b8b315629a195a2383e58ba0ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 17:19:46 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_signatures.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 0416630b2..3801752c6 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -394,20 +394,23 @@ int32_t LP_pubkey_sigcheck(struct LP_pubkeyinfo *pubp,cJSON *item) { decode_hex(pubsecp,sizeof(pubsecp),pubsecpstr); calc_rmd160_sha256(checkrmd160,pubsecp,33); - if ( memcmp(checkrmd160,rmd160,20) == 0 && (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) + if ( memcmp(checkrmd160,rmd160,20) == 0 ) { - siglen = len >> 1; - decode_hex(sig,siglen,sigstr); - if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + if ( (sigstr= jstr(item,"sig")) != 0 && (len= is_hexstr(sigstr,0)) == 65*2 ) { - for (i=0; i<20; i++) - printf("%02x",pubp->rmd160[i]); - memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); - memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); - char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); - retval = 0; - pubp->timestamp = (uint32_t)time(NULL); - } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + siglen = len >> 1; + decode_hex(sig,siglen,sigstr); + if ( _LP_pubkey_sigcheck(sig,siglen,pubp->pubkey,rmd160,pubsecp) == 0 ) + { + for (i=0; i<20; i++) + printf("%02x",pubp->rmd160[i]); + memcpy(pubp->rmd160,rmd160,sizeof(pubp->rmd160)); + memcpy(pubp->pubsecp,pubsecp,sizeof(pubp->pubsecp)); + char str[65]; printf(" -> rmd160.(%s) for %s (%s) sig.%s\n",hexstr,bits256_str(str,pubp->pubkey),pubsecpstr,sigstr); + retval = 0; + pubp->timestamp = (uint32_t)time(NULL); + } //else printf("sig %s error pub33.%s\n",sigstr,pubsecpstr); + } } else {