gcc-8: fix komodo_connectblock reaches end of non-void function error
This commit is contained in:
15
src/komodo.h
15
src/komodo.h
@@ -803,7 +803,10 @@ int32_t komodo_notarycmp(uint8_t *scriptPubKey,int32_t scriptlen,uint8_t pubkeys
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// int32_t !
|
||||
// int32_t (!!!)
|
||||
/*
|
||||
read blackjok3rtt comments in main.cpp
|
||||
*/
|
||||
int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
||||
{
|
||||
static int32_t hwmheight;
|
||||
@@ -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);
|
||||
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);
|
||||
} 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);
|
||||
//fprintf(stderr,"%s end connect.%d\n",ASSETCHAINS_SYMBOL,pindex->GetHeight());
|
||||
if (fJustCheck)
|
||||
@@ -1025,6 +1030,12 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
||||
return(1);
|
||||
if ( notarisations.size() > 1 || (notarisations.size() == 1 && notarisations[0] != 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user