From e06da87bee190a29565875a25757484da1106b3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 31 Dec 2017 16:06:57 +0700 Subject: [PATCH] Test --- iguana/exchanges/LP_bitcoin.c | 2 +- iguana/exchanges/mm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_bitcoin.c b/iguana/exchanges/LP_bitcoin.c index c9bf41c1e..ebb6abead 100644 --- a/iguana/exchanges/LP_bitcoin.c +++ b/iguana/exchanges/LP_bitcoin.c @@ -2207,7 +2207,7 @@ int32_t bitcoin_priv2wif(uint8_t wiftaddr,char *wifstr,bits256 privkey,uint8_t a //data[0] = addrtype; offset = 1; } - memcpy(data+offset,privkey.bytes,sizeof(privkey)); + memcpy(data+offset,privkey.bytes,len); data[offset + len++] = 1; len = base58encode_checkbuf(wiftaddr,addrtype,data,len); if ( bitcoin_base58encode(wifstr,data,len) == 0 ) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index d09b79935..2428a5061 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -117,7 +117,7 @@ int main(int argc, const char * argv[]) for (i=0; i<1000000000; i++) { OS_randombytes(privkey.bytes,sizeof(privkey)); - bitcoin_priv2wif(0xab,wifstr,privkey,0x36); + bitcoin_priv2wif(0x36,wifstr,privkey,0xab); if ( wifstr[3] == 'h' && wifstr[4] == 'u' && wifstr[5] == 's' ) { printf("i.%d %s -> wif.%s\n",i,bits256_str(str,privkey),wifstr);