From 6402fab251f08ccdaea880f591ec40e39e366217 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 26 Mar 2018 05:45:25 +0300 Subject: [PATCH] Test --- src/komodo_notary.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 961c1e866..de93f57bd 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -236,6 +236,7 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam htind = height / KOMODO_ELECTION_GAP; if ( htind >= KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP ) htind = (KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP) - 1; + printf("Pubkeys.%p htind.%d vs max.%d\n",Pubkeys,htind,KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP); pthread_mutex_lock(&komodo_mutex); n = Pubkeys[htind].numnotaries; if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) @@ -288,7 +289,7 @@ void komodo_notarysinit(int32_t origheight,uint8_t pubkeys[64][33],int32_t num) static int32_t hwmheight; int32_t k,i,htind,height; struct knotary_entry *kp; struct knotaries_entry N; if ( Pubkeys == 0 ) - Pubkeys = (struct knotaries_entry *)calloc(KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP,sizeof(*Pubkeys)); + Pubkeys = (struct knotaries_entry *)calloc(1 + (KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP),sizeof(*Pubkeys)); memset(&N,0,sizeof(N)); if ( origheight > 0 ) {