[dpos] reject the reorganization beyond a LIB
@@ -131,9 +131,6 @@ func decode(r io.Reader, e interface{}) error {
// NeedReorganization reports whether reorganization is needed or not.
func (s *Status) NeedReorganization(rootNo types.BlockNo) bool {
- return true
-
- /*
s.RLock()
defer s.RUnlock()
@@ -145,15 +142,14 @@ func (s *Status) NeedReorganization(rootNo types.BlockNo) bool {
libNo := s.lib.BlockNo
reorganizable := rootNo >= libNo
- if reorganizable {
+ if !reorganizable {
logger.Info().
Uint64("LIB", libNo).
Uint64("branch root no", rootNo).
- Msg("not reorganizable - the current main branch has a LIB.")
+ Msg("reorganization beyond LIB is not allowed")
}
return reorganizable
- */
}
// Init recovers the last DPoS status including pre-LIB map and confirms
