|
|
@ -2054,11 +2054,15 @@ int32_t bitcoin_addr2rmd160(char *symbol,uint8_t taddr,uint8_t *addrtypep,uint8_ |
|
|
|
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 )
|
|
|
|
{ |
|
|
|
strcpy(prefixaddr,"bitcoincash:"); |
|
|
|
char *bchprefix = "bitcoincash:"; |
|
|
|
if ( strncmp(coinaddr,bchprefix,strlen(bchprefix)) != 0 ) |
|
|
|
{ |
|
|
|
strcpy(prefixaddr,bchprefix); |
|
|
|
strcat(prefixaddr,coinaddr); |
|
|
|
} else strcpy(prefixaddr,coinaddr); |
|
|
|
if ( bech32_decode(hrp,data5,&len5,prefixaddr) == 0 ) |
|
|
|
{ |
|
|
|
printf("bitcoin_addr2rmd160 bech32_decode error.(%s)\n",coinaddr); |
|
|
|
printf("bitcoin_addr2rmd160 bech32_decode error.(%s)\n",prefixaddr); |
|
|
|
return(0); |
|
|
|
} |
|
|
|
len = 0; |
|
|
|