From 0d2d1625bc4b666407d1d3334dadb38666efbb37 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 12 Apr 2019 01:41:33 -1100 Subject: [PATCH] Test --- src/main.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 42e2414b9..1493409bb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5335,17 +5335,13 @@ bool AcceptBlock(int32_t *futureblockp,CBlock& block, CValidationState& state, C *futureblockp = 1; if ( ASSETCHAINS_CBOPRET != 0 ) { - CValidationState tmpstate; CBlockIndex *tmpindex; int32_t ht; + CValidationState tmpstate; CBlockIndex *tmpindex; int32_t ht,longest; ht = (int32_t)pindex->GetHeight(); - if ( (tmpindex=komodo_chainactive(ht-1)) != 0 ) + longest = komodo_longestchain(); + if ( (longest == 0 || ht < longest-6) && (tmpindex=komodo_chainactive(ht)) != 0 ) { - fprintf(stderr,"reconsider height.%d\n",(int32_t)ht-1); - ReconsiderBlock(tmpstate,tmpindex); - if ( (tmpindex=komodo_chainactive(ht)) != 0 ) - { - fprintf(stderr,"reconsider height.%d\n",(int32_t)ht); - ReconsiderBlock(tmpstate,tmpindex); - } + fprintf(stderr,"reconsider height.%d, longest.%d\n",(int32_t)ht,longest); + InvalidateBlock(tmpstate,tmpindex); } } }