From 5bdebffe1b8bc28fbbae6a12bd2b8f2df5cd76b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 18 Oct 2016 21:04:26 -0300 Subject: [PATCH] test --- src/komodo.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index f0f4e0ba4..fb9aa0b75 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -236,20 +236,22 @@ int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp) void komodo_connectblock(CBlockIndex *pindex,CBlock& block) { - char *scriptstr,*opreturnstr; uint64_t voutmask; uint32_t notarizedheight; uint8_t opret[256]; - int32_t i,j,k,opretlen,notaryid,len,numvouts,numvins,height,txn_count; uint256 kmdtxid,btctxid,txhash; + char *scriptstr,*opreturnstr; uint64_t signedmask,voutmask; uint32_t notarizedheight; + uint8_t opret[256]; uint256 kmdtxid,btctxid,txhash; + int32_t i,j,k,opretlen,notaryid,len,numvouts,numvins,height,txn_count; // update voting results and official (height, notaries[]) if ( pindex != 0 ) { height = pindex->nHeight; txn_count = block.vtx.size(); + notarizedheight = 0; for (i=0; i=0?Notaries[notaryid][0]:"",height,i,numvins,numvouts,j,txhash.ToString().c_str()); } - if ( notaryid >= 0 && voutmask != 0 ) - komodo_nutxoadd(notaryid,txhash,voutmask,numvouts); - for (voutmask=j=0; j= 0 ) - voutmask |= (1LL << notaryid); - } - if ( voutmask != 0 ) - { - printf("NOTARY SIGNED.%llx ht.%d txi.%d\n",(long long)voutmask,height,i); + signedmask |= (1LL << notaryid); } + if ( signedmask != 0 && notaryid >= 0 && voutmask != 0 ) + komodo_nutxoadd(notaryid,txhash,voutmask,numvouts); + } + if ( signedmask != 0 ) + { + printf("NOTARY SIGNED.%llx ht.%d txi.%d notaryht.%d\n",(long long)voutmask,height,i,notarizedheight); } } else printf("komodo_connectblock: unexpected null pindex\n"); }