From 6039944bc5f4eaa6c66f328a3eda8d40884a1e88 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 21 Jan 2018 12:46:43 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_bitcoin.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index ccebaf252..79ea96189 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -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:"); - strcat(prefixaddr,coinaddr); + 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;