From 859653732a7d48ac31c1163c80323da4e8852f38 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 19 Jan 2018 22:36:30 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3c1e1566e..7aabc9cbb 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -737,25 +737,24 @@ void bech32_tests() //char *test = "an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1tt5tgs"; char *test = "bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a"; //char *test = "prefix:x64nx6hz"; - uint8_t data[82],data2[64],rmd160[20],addrtype; char rebuild[92],hrp[84]; size_t data_len,data_len2; int32_t i; + uint8_t data[82],data2[64],rmd160[21],addrtype; char rebuild[92],hrp[84]; size_t data_len,data_len2; int32_t i; if ( bech32_decode(hrp,data,&data_len,test) == 0 ) { printf("bech32_decode fails: '%s'\n",test); } else { - bitcoin_addr2rmd160(0,&addrtype,rmd160,"1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"); + bitcoin_addr2rmd160(0,&addrtype,rmd160+1,"1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"); for (i=0; i ",(int32_t)data_len,test,"1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"); for (i=0; i<20; i++) - printf("%02x",rmd160[i]); + printf("%02x",rmd160[i+1]); printf("\n"); } data_len2 = 0; - data2[0] = 0; - bech32_convert_bits(data2 + 1,&data_len2,5,rmd160,20,8,1); - data_len2++; + rmd160[0] = (0 << 3); + bech32_convert_bits(data2,&data_len2,5,rmd160,21,8,1); for (i=0; i