From d067063f13fbae1132d5f78f842ce36009477e49 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 18 Oct 2016 15:37:26 -0300 Subject: [PATCH] test --- src/komodo.h | 14 ++++++++++++-- src/main.cpp | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 5a2d4565b..d5261e67b 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -90,7 +90,7 @@ int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp) void komodo_connectblock(CBlockIndex *pindex,CBlock& block) { - char *scriptstr; int32_t i,j,numvins,numvouts,height,txn_count; + char *scriptstr; int32_t i,j,k,numvins,numvouts,height,txn_count; // update voting results and official (height, notaries[]) if ( pindex != 0 ) { @@ -107,7 +107,17 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) printf(">>>>>>>> "); else if ( j == 0 ) { - + for (k=0; k<64; k++) + { + if ( Notaries[k][0] == 0 || Notaries[k][1] == 0 || Notaries[k][0][0] == 0 || Notaries[k][1][0] == 0 ) + break; + if ( strncmp(Notaries[k][1],coinbasestr,66) == 0 ) + { + printf("%s ht.%d (%s)\n",Notaries[k][0],height,coinbasestr); + //*nBitsp = KOMODO_MINDIFF_NBITS; + break; + } + } } printf("ht.%d txi.%d vout.%d (%s)\n",height,i,j,scriptstr); } diff --git a/src/main.cpp b/src/main.cpp index 6fc1076fd..eb1a45385 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2221,7 +2221,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin int64_t nTime4 = GetTimeMicros(); nTimeCallbacks += nTime4 - nTime3; LogPrint("bench", " - Callbacks: %.2fms [%.2fs]\n", 0.001 * (nTime4 - nTime3), nTimeCallbacks * 0.000001); - FlushStateToDisk(); + //FlushStateToDisk(); komodo_connectblock(pindex,*(CBlock *)&block); return true;