From 27fa4f8cdbeeedf3563e8f5b90c7461fe5da493a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 14 Nov 2016 13:18:13 -0300 Subject: [PATCH] test --- src/komodo_notary.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index b43973b4c..02c702a0f 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -54,13 +54,6 @@ const char *Notaries_genesis[][2] = #define KOMODO_ELECTION_GAP ((ASSETCHAINS_SYMBOL[0] == 0) ? 2000 : 100) -int32_t KOMODO_PUBKEYS_HEIGHT(int32_t height) -{ - height += KOMODO_ELECTION_GAP/2; - height /= KOMODO_ELECTION_GAP; - return((height + 1) * KOMODO_ELECTION_GAP); -} - struct nutxo_entry { UT_hash_handle hh; uint256 txhash; uint64_t voutmask; int32_t notaryid,height; } *NUTXOS; struct knotary_entry { UT_hash_handle hh; uint8_t pubkey[33],notaryid; }; struct knotaries_entry { int32_t height,numnotaries; struct knotary_entry *Notaries; } Pubkeys[10000]; @@ -100,8 +93,7 @@ int32_t komodo_ratify_threshold(int32_t height,uint64_t signedmask) int32_t htind,numnotaries,i,wt = 0; if ( ASSETCHAINS_SYMBOL[0] != 0 ) return(2); - if ( (htind= KOMODO_PUBKEYS_HEIGHT(height) / KOMODO_ELECTION_GAP) == 0 ) - htind = 1; + htind = height / KOMODO_ELECTION_GAP; numnotaries = Pubkeys[htind].numnotaries; for (i=0; i= sizeof(Pubkeys)/sizeof(*Pubkeys) ) return(-1); - if ( (htind= KOMODO_PUBKEYS_HEIGHT(height) / KOMODO_ELECTION_GAP) == 0 ) - htind = 1; + htind = height / KOMODO_ELECTION_GAP; pthread_mutex_lock(&komodo_mutex); HASH_FIND(hh,Pubkeys[htind].Notaries,pubkey33,33,kp); pthread_mutex_unlock(&komodo_mutex);