Browse Source

test

etomic
jl777 8 years ago
parent
commit
d171c0b023
  1. 6
      iguana/dpow/dpow_network.c
  2. 9
      iguana/iguana_secp.c

6
iguana/dpow/dpow_network.c

@ -63,9 +63,9 @@ int32_t signed_nn_recv(void **freeptrp,void *ctx,uint8_t notaries[64][33],int32_
*freeptrp = 0;
if ( (recvbytes= nn_recv(sock,&sigpacket,NN_MSG,0)) > 0 )
{
for (i=0; i<recvbytes; i++)
printf("%02x",((uint8_t *)sigpacket)[i]);
printf(" <- RECV.%d\n",recvbytes);
//for (i=0; i<recvbytes; i++)
// printf("%02x",((uint8_t *)sigpacket)[i]);
//printf(" <- RECV.%d\n",recvbytes);
}
if ( sigpacket != 0 && recvbytes > sizeof(*sigpacket) && sigpacket->packetlen == recvbytes-sizeof(*sigpacket) )
{

9
iguana/iguana_secp.c

@ -131,8 +131,13 @@ int32_t bitcoin_sign(void *ctx,char *symbol,uint8_t *sig,bits256 txhash2,bits256
{
sig[0] = 27 + recid + (fCompressed != 0 ? 4 : 0);
retval = 64 + 1;
}
else printf("secpub mismatch\n");
size_t i,plen = 33; uint8_t pubkey[33];
secp256k1_ec_pubkey_serialize(ctx,pubkey,&plen,&CHECKPUB,SECP256K1_EC_COMPRESSED);
for (i=0; i<33; i++)
printf("%02x",pubkey[i]);
printf(" bitcoin_sign's pubkey\n");
} else printf("secpub mismatch\n");
} else printf("pubkey create error\n");
} else printf("recover error\n");
} else printf("secp256k1_ecdsa_sign_recoverable error\n");

Loading…
Cancel
Save