From 0f476b5b90c8d2d42fdda0458d5d1accdbdf51b8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 21 Oct 2016 07:11:52 -0300 Subject: [PATCH] test --- src/komodo.h | 9 +++++---- src/main.cpp | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 8c1badea8..e0b89c4de 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -273,10 +273,7 @@ void komodo_notarysinit(int32_t height,uint8_t pubkeys[64][33],int32_t num) int32_t komodo_heightnotary(int32_t height,uint8_t *pubkey33) { // -1 if not notary, 0 if notary, 1 if special notary - struct knotary_entry *kp; int32_t numnotaries,modval = -1; - //int32_t i; for (i=0; i<33; i++) - // printf("%02x",pubkey33[i]); - //printf(" ht.%d\n",height); + struct knotary_entry *kp; int32_t numnotaries,notaryid = -1,modval = -1; pthread_mutex_lock(&komodo_mutex); HASH_FIND(hh,Pubkeys[height/KOMODO_ELECTION_GAP].Notaries,pubkey33,33,kp); @@ -285,10 +282,14 @@ int32_t komodo_heightnotary(int32_t height,uint8_t *pubkey33) { if ( (numnotaries= Pubkeys[height/KOMODO_ELECTION_GAP].numnotaries) > 0 ) { + notaryid = kp->notaryid; modval = ((height % numnotaries) == kp->notaryid); //printf("found notary.%d ht.%d modval.%d\n",kp->notaryid,height,modval); } else printf("unexpected zero notaries at height.%d\n",height); } + int32_t i; for (i=0; i<33; i++) + printf("%02x",pubkey33[i]); + printf(" ht.%d notary.%d special.%d\n",height,notaryid,modval); return(modval); } diff --git a/src/main.cpp b/src/main.cpp index b3940707c..73d71904a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2365,7 +2365,8 @@ void static UpdateTip(CBlockIndex *pindexNew) { nTimeBestReceived = GetTime(); mempool.AddTransactionsUpdated(1); - LogPrintf("%s: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%.1fMiB(%utx)\n", __func__, + if ( 0 ) + LogPrintf("%s: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%.1fMiB(%utx)\n", __func__, chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx, DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()), Checkpoints::GuessVerificationProgress(chainParams.Checkpoints(), chainActive.Tip()), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());