Browse Source

Test

etomic
jl777 7 years ago
parent
commit
51e5166882
  1. 8
      iguana/exchanges/LP_bitcoin.c
  2. 2
      iguana/exchanges/mm.c

8
iguana/exchanges/LP_bitcoin.c

@ -2198,18 +2198,18 @@ int32_t bitcoin_priv2wif(uint8_t wiftaddr,char *wifstr,bits256 privkey,uint8_t a
uint8_t data[128]; int32_t offset,len = 32; uint8_t data[128]; int32_t offset,len = 32;
if ( wiftaddr != 0 ) if ( wiftaddr != 0 )
{ {
data[0] = wiftaddr; //data[0] = wiftaddr;
data[1] = addrtype; //data[1] = addrtype;
offset = 2; offset = 2;
} }
else else
{ {
data[0] = addrtype; //data[0] = addrtype;
offset = 1; offset = 1;
} }
memcpy(data+offset,privkey.bytes,sizeof(privkey)); memcpy(data+offset,privkey.bytes,sizeof(privkey));
data[offset + len++] = 1; data[offset + len++] = 1;
//len = base58encode_checkbuf(wiftaddr,addrtype,data,len); len = base58encode_checkbuf(wiftaddr,addrtype,data,len);
if ( bitcoin_base58encode(wifstr,data,len) == 0 ) if ( bitcoin_base58encode(wifstr,data,len) == 0 )
{ {
char str[65]; printf("error making wif from %s\n",bits256_str(str,privkey)); char str[65]; printf("error making wif from %s\n",bits256_str(str,privkey));

2
iguana/exchanges/mm.c

@ -118,7 +118,7 @@ int main(int argc, const char * argv[])
{ {
OS_randombytes(privkey.bytes,sizeof(privkey)); OS_randombytes(privkey.bytes,sizeof(privkey));
bitcoin_priv2wif(0xab,wifstr,privkey,0x36); bitcoin_priv2wif(0xab,wifstr,privkey,0x36);
if ( wifstr[3] == 'H' && wifstr[4] == 'u' && wifstr[5] == 's' ) if ( wifstr[3] == 'h' && wifstr[4] == 'u' && wifstr[5] == 's' )
{ {
printf("i.%d %s -> wif.%s\n",i,bits256_str(str,privkey),wifstr); printf("i.%d %s -> wif.%s\n",i,bits256_str(str,privkey),wifstr);
if ( wifstr[6] == 'h' ) if ( wifstr[6] == 'h' )

Loading…
Cancel
Save