From 055aa0d33fd0b1a2774a8b4ea57d8307bec98e32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 14 Jan 2017 18:04:42 +0200 Subject: [PATCH] test --- iguana/dpow/dpow_network.c | 13 ++++++++----- iguana/iguana_secp.c | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 723d642db..7dc9fcfdb 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -23,7 +23,7 @@ struct signed_nnpacket int32_t signed_nn_send(void *ctx,bits256 privkey,int32_t sock,void *packet,int32_t size) { - int32_t i,sentbytes,siglen = 0; uint8_t sig[65],pubkey33[33]; struct signed_nnpacket *sigpacket; + int32_t i,j,sentbytes,siglen = 0; uint8_t sig[65],pubkey33[33]; struct signed_nnpacket *sigpacket; if ( (sigpacket= calloc(1,size + sizeof(*sigpacket))) != 0 ) { sigpacket->packetlen = size; @@ -39,11 +39,14 @@ int32_t signed_nn_send(void *ctx,bits256 privkey,int32_t sock,void *packet,int32 if ( i < 10000 && (siglen= bitcoin_sign(ctx,"nnsend",sig,sigpacket->packethash,privkey,1)) > 0 && siglen == 65 ) { memcpy(sigpacket->sig64,sig+1,64); - if ( bitcoin_recoververify(ctx,"nnrecv",sigpacket->sig64,sigpacket->packethash,pubkey33,33) == 0 ) + for (j=0; j<10; j++) { - for (i=0; i<33; i++) - printf("%02x",pubkey33[i]); - printf(" signed pubkey\n"); + if ( bitcoin_recoververify(ctx,"nnrecv",sigpacket->sig64,sigpacket->packethash,pubkey33,33) == 0 ) + { + for (i=0; i<33; i++) + printf("%02x",pubkey33[i]); + printf(" signed pubkey\n"); + } } sentbytes = nn_send(sock,sigpacket,size + sizeof(*sigpacket),0); //for (i=0; i