From df383ab0be05fc9265972c4c51d476dbfa2fb59e Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 15 Mar 2019 18:19:53 +0800 Subject: [PATCH] try --- iguana/dpow/dpow_fsm.c | 4 ++-- iguana/dpow/dpow_network.c | 2 +- iguana/dpow/dpow_tx.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index c419dc16e..5e0fd88a9 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -297,11 +297,11 @@ void dpow_statemachinestart(void *ptr) } if ( (bp= dpow_heightfind(myinfo,dp, checkpoint.blockhash.height)) == 0 ) { + if ( (blockindex= dpow_blockfind(myinfo,dp)) < 0 ) + return; bp = calloc(1,sizeof(*bp)); - blockindex = dpow_blockfind(myinfo,dp); dp->blocks[blockindex] = bp; printf("blockindex.%i allocate bp for %s ht.%d -> %s\n",blockindex,src->symbol,checkpoint.blockhash.height,dest->symbol); - //Numallocated++; bp->MoM = MoM; bp->MoMdepth = MoMdepth; bp->CCid = dp->fullCCid & 0xffff; diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 557700205..19ea04b01 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -2326,7 +2326,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) dpow_datahandler(myinfo,dp,bp,np->senderind,np->channel,np->height,np->packet,np->datalen); } else printf("wrong senderind.%d\n",np->senderind); } - } //else printf("height.%d bp.%p state.%x senderind.%d\n",np->height,bp,bp!=0?bp->state:0,np->senderind); + } else printf("height.%d bp.%p state.%x senderind.%d\n",np->height,bp,bp!=0?bp->state:0,np->senderind); //dp->crcs[firstz] = crc32; } } //else printf("crc error from.%d %x vs %x or no dp.%p [%s]\n",np->senderind,crc32,np->crc32,dp,np->symbol); diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 6a9f99d60..db7a47112 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -190,7 +190,7 @@ int32_t dpow_blockfind(struct supernet_info *myinfo,struct dpow_info *dp) if ( dp->blocks[i] == 0 ) return(i); } - return(0); + return(-1); } /* maybe this is better not sure... @@ -204,7 +204,7 @@ int32_t dpow_blockfind(struct supernet_info *myinfo,struct dpow_info *dp) if ( dp->blocks[i] == 0 ) break; } - return(0); + return(-1); }*/ int32_t dpow_voutstandard(struct supernet_info *myinfo,struct dpow_block *bp,uint8_t *serialized,int32_t m,int32_t src_or_dest,uint8_t pubkeys[][33],int32_t numratified)