mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-10 01:56:08 +00:00
hacking
This commit is contained in:
+1
-1
@@ -191,7 +191,7 @@ func makeNode(config *cfg.Config,
|
||||
}
|
||||
|
||||
// Determine whether we should attempt state sync.
|
||||
stateSync := config.StateSync.Enable && !onlyValidatorIsUs(state, pubKey)
|
||||
stateSync := config.StateSync.Enable && !onlyValidatorIsUs(genDoc, pubKey)
|
||||
if stateSync && state.LastBlockHeight > 0 {
|
||||
logger.Info("Found local state with non-zero height, skipping state sync")
|
||||
stateSync = false
|
||||
|
||||
+4
-4
@@ -182,12 +182,12 @@ func logNodeStartupInfo(state sm.State, pubKey crypto.PubKey, logger, consensusL
|
||||
}
|
||||
}
|
||||
|
||||
func onlyValidatorIsUs(state sm.State, pubKey crypto.PubKey) bool {
|
||||
if state.Validators.Size() > 1 {
|
||||
func onlyValidatorIsUs(genDoc *types.GenesisDoc, pubKey crypto.PubKey) bool {
|
||||
if len(genDoc.Validators) > 1 || pubKey == nil {
|
||||
return false
|
||||
}
|
||||
addr, _ := state.Validators.GetByIndex(0)
|
||||
return pubKey != nil && bytes.Equal(pubKey.Address(), addr)
|
||||
|
||||
return bytes.Equal(pubKey.Address(), genDoc.Validators[0].Address)
|
||||
}
|
||||
|
||||
func createMempoolReactor(
|
||||
|
||||
Reference in New Issue
Block a user