gcc-8: fix komodo_connectblock reaches end of non-void function error
This commit is contained in:
21
src/komodo.h
21
src/komodo.h
@@ -803,7 +803,10 @@ int32_t komodo_notarycmp(uint8_t *scriptPubKey,int32_t scriptlen,uint8_t pubkeys
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// int32_t !
|
// int32_t (!!!)
|
||||||
|
/*
|
||||||
|
read blackjok3rtt comments in main.cpp
|
||||||
|
*/
|
||||||
int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
||||||
{
|
{
|
||||||
static int32_t hwmheight;
|
static int32_t hwmheight;
|
||||||
@@ -897,8 +900,8 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
|||||||
}
|
}
|
||||||
numvalid = bitweight(signedmask);
|
numvalid = bitweight(signedmask);
|
||||||
if ( ((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) ||
|
if ( ((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) ||
|
||||||
(numvalid >= KOMODO_MINRATIFY && ASSETCHAINS_SYMBOL[0] != 0) ||
|
(numvalid >= KOMODO_MINRATIFY && ASSETCHAINS_SYMBOL[0] != 0) ||
|
||||||
numvalid > (numnotaries/5) )
|
numvalid > (numnotaries/5) )
|
||||||
{
|
{
|
||||||
if ( !fJustCheck && ASSETCHAINS_SYMBOL[0] != 0)
|
if ( !fJustCheck && ASSETCHAINS_SYMBOL[0] != 0)
|
||||||
{
|
{
|
||||||
@@ -918,7 +921,7 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
|||||||
fflush(signedfp);
|
fflush(signedfp);
|
||||||
}
|
}
|
||||||
transaction = i;
|
transaction = i;
|
||||||
printf("[%s] ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts);
|
printf("[%s] ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts);
|
||||||
}
|
}
|
||||||
notarized = 1;
|
notarized = 1;
|
||||||
}
|
}
|
||||||
@@ -1014,7 +1017,9 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
|||||||
printf("%s ht.%d\n",ASSETCHAINS_SYMBOL[0] == 0 ? "KMD" : ASSETCHAINS_SYMBOL,height);
|
printf("%s ht.%d\n",ASSETCHAINS_SYMBOL[0] == 0 ? "KMD" : ASSETCHAINS_SYMBOL,height);
|
||||||
if ( !fJustCheck && pindex->GetHeight() == hwmheight )
|
if ( !fJustCheck && pindex->GetHeight() == hwmheight )
|
||||||
komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,(uint32_t)pindex->nTime,0,0,0,0,zero,0);
|
komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,(uint32_t)pindex->nTime,0,0,0,0,zero,0);
|
||||||
} else fprintf(stderr,"komodo_connectblock: unexpected null pindex\n");
|
}
|
||||||
|
else
|
||||||
|
{ fprintf(stderr,"komodo_connectblock: unexpected null pindex\n"); return(0); }
|
||||||
//KOMODO_INITDONE = (uint32_t)time(NULL);
|
//KOMODO_INITDONE = (uint32_t)time(NULL);
|
||||||
//fprintf(stderr,"%s end connect.%d\n",ASSETCHAINS_SYMBOL,pindex->GetHeight());
|
//fprintf(stderr,"%s end connect.%d\n",ASSETCHAINS_SYMBOL,pindex->GetHeight());
|
||||||
if (fJustCheck)
|
if (fJustCheck)
|
||||||
@@ -1025,6 +1030,12 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
|||||||
return(1);
|
return(1);
|
||||||
if ( notarisations.size() > 1 || (notarisations.size() == 1 && notarisations[0] != 1) )
|
if ( notarisations.size() > 1 || (notarisations.size() == 1 && notarisations[0] != 1) )
|
||||||
return(-1);
|
return(-1);
|
||||||
|
|
||||||
|
fprintf(stderr,"komodo_connectblock: unxexpected behaviour when fJustCheck == true, report blackjok3rtt plz ! \n");
|
||||||
|
/* this needed by gcc-8, it counts here that control reaches end of non-void function without this.
|
||||||
|
by default, we count that if control reached here -> the valid notarization isnt in position 1 or there are too many notarizations in this block.
|
||||||
|
*/
|
||||||
|
return(-1);
|
||||||
}
|
}
|
||||||
else return(0);
|
else return(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user