From e08d8fdc621161f20c879e40993927fb5b92614e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Jul 2016 10:06:18 -0300 Subject: [PATCH] test --- iguana/exchanges/bitcoin.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/bitcoin.c b/iguana/exchanges/bitcoin.c index 14eb44101..2f83a2f39 100755 --- a/iguana/exchanges/bitcoin.c +++ b/iguana/exchanges/bitcoin.c @@ -31,21 +31,20 @@ int32_t bitcoin_addr2rmd160(uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr if ( (len= bitcoin_base58decode(buf,coinaddr)) >= 4 ) { // validate with trailing hash, then remove hash - hash = bits256_doublesha256(0,buf,len - 4); + hash = bits256_doublesha256(0,buf,21); *addrtypep = *buf; memcpy(rmd160,buf+1,20); - if ( (buf[len - 4]&0xff) == hash.bytes[31] && (buf[len - 3]&0xff) == hash.bytes[30] &&(buf[len - 2]&0xff) == hash.bytes[29] &&(buf[len - 1]&0xff) == hash.bytes[28] ) + if ( (buf[21]&0xff) == hash.bytes[31] && (buf[22]&0xff) == hash.bytes[30] &&(buf[23]&0xff) == hash.bytes[29] && (buf[24]&0xff) == hash.bytes[28] ) { //printf("coinaddr.(%s) valid checksum addrtype.%02x\n",coinaddr,*addrtypep); return(20); } else { - //char hexaddr[64]; - //btc_convaddr(hexaddr,coinaddr); - //for (i=0; i