From 8ace53a2fad4c4de9be47a1ab6d0d63da6252657 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Apr 2016 17:42:17 -0500 Subject: [PATCH] test --- iguana/iguana_msg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index dd62ce425..388655955 100755 --- a/iguana/iguana_msg.c +++ b/iguana/iguana_msg.c @@ -571,20 +571,20 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc { int32_t reqvers,flag = 0; addr->msgcounts.getblocks++; - len = iguana_rwnum(0,&data[sizeof(struct iguana_msghdr)],sizeof(uint32_t),&reqvers); - len += iguana_rwvarint32(0,&data[sizeof(struct iguana_msghdr) + len],(uint32_t *)&n); + len = iguana_rwnum(0,&data[0],sizeof(uint32_t),&reqvers); + len += iguana_rwvarint32(0,&data[len],(uint32_t *)&n); for (i=0; i<10; i++) printf("%02x ",data[i]); printf("version.%d num blocks.%d recvlen.%d\n",reqvers,n,recvlen); for (i=0; iblockspace,sizeof(addr->blockspace),addr,hash2,0) > 0 ) flag = 1; } - len += iguana_rwbignum(0,&data[sizeof(struct iguana_msghdr) + len],sizeof(bits256),hash2.bytes); + len += iguana_rwbignum(0,&data[len],sizeof(bits256),hash2.bytes); //len = recvlen; } } @@ -633,11 +633,11 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc else { addr->msgcounts.getheaders++; - len = iguana_rwnum(0,&data[sizeof(struct iguana_msghdr)],sizeof(uint32_t),&tmp); - len += iguana_rwvarint32(0,&data[sizeof(struct iguana_msghdr) + len],(uint32_t *)&n); + len = iguana_rwnum(0,&data[0],sizeof(uint32_t),&tmp); + len += iguana_rwvarint32(0,&data[len],(uint32_t *)&n); for (i=nonz=0; i 0 )