jl777 7 years ago
parent
commit
0840857f3b
  1. 2
      iguana/exchanges/LP_bitcoin.c
  2. 3
      iguana/mini-gmp.c

2
iguana/exchanges/LP_bitcoin.c

@ -2052,7 +2052,7 @@ bits256 bits256_calcaddrhash(char *symbol,uint8_t *serialized,int32_t len)
int32_t bitcoin_addr2rmd160(char *symbol,uint8_t taddr,uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr) int32_t bitcoin_addr2rmd160(char *symbol,uint8_t taddr,uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr)
{ {
bits256 hash; uint8_t *buf,_buf[26],data5[128],rmd21[21]; char prefixaddr[64],hrp[64]; int32_t len,len5,offset; bits256 hash; uint8_t *buf,_buf[26],data5[128],rmd21[21]; char prefixaddr[64],hrp[64]; int32_t len,len5,offset;
if ( strcmp(symbol,"BCH") == 0 && strlen(coinaddr) == 42 ) if ( strcmp(symbol,"BCH") == 0 )//&& strlen(coinaddr) == 42 )
{ {
strcpy(prefixaddr,"bitcoincash:"); strcpy(prefixaddr,"bitcoincash:");
strcat(prefixaddr,coinaddr); strcat(prefixaddr,coinaddr);

3
iguana/mini-gmp.c

@ -4386,6 +4386,8 @@ bits256 mpz_to_bits256(mpz_t bn)
return(x); return(x);
} }
extern int32_t zeroval();
int32_t bitcoin_base58decode(uint8_t *data,char *coinaddr) int32_t bitcoin_base58decode(uint8_t *data,char *coinaddr)
{ {
uint32_t zeroes,be_sz=0; size_t count; const char *p,*p1; mpz_t bn58,bn; int32_t nonz=0; uint32_t zeroes,be_sz=0; size_t count; const char *p,*p1; mpz_t bn58,bn; int32_t nonz=0;
@ -4404,6 +4406,7 @@ int32_t bitcoin_base58decode(uint8_t *data,char *coinaddr)
{ {
printf("bitcoin_base58decode error: p %02x != 0x00\n",*p); printf("bitcoin_base58decode error: p %02x != 0x00\n",*p);
mpz_clear(bn), mpz_clear(bn58); mpz_clear(bn), mpz_clear(bn58);
printf("death.%d\n",1/zeroval());
return(-1); return(-1);
} }
break; break;

Loading…
Cancel
Save