From b501ded2ba441ac7c838d891925809cf698e5c7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 18 Oct 2016 12:46:23 -0300 Subject: [PATCH] test --- src/komodo.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index 15464138d..d9d482552 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -28,8 +28,12 @@ int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp) // 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS // -1 -> invalid, ie, prior to notarized block CBlock block; int32_t height; char *coinbasestr; - if ( ReadBlockFromDisk(block,pindex) == 0 ) + block.SetNull(); + CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); + if ( filein.IsNull() ) return(-1); + try { filein >> block; } + catch (const std::exception& e) { return(-1); } height = pindex->nHeight; coinbasestr = (char *)block.vtx[0].vout[0].scriptPubKey.ToString().c_str(); printf("ht.%d (%s)\n",height,coinbasestr); @@ -39,7 +43,12 @@ int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp) void komodo_connectblock(CBlockIndex *pindex,CBlock& block) { + int32_t i; // update voting results and official (height, notaries[]) + for (i=0; i