jl777 7 years ago
parent
commit
85d01b1afb
  1. 27
      iguana/exchanges/LP_signatures.c

27
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
{

Loading…
Cancel
Save