mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-16 04:06:12 +00:00
Improve reconnections + fixing unit tests
This commit is contained in:
+7
-2
@@ -296,18 +296,23 @@ func NewNode(config *cfg.Config,
|
||||
}
|
||||
}
|
||||
|
||||
pubKey := privValidator.GetPubKey()
|
||||
if pubKey == nil {
|
||||
return nil, fmt.Errorf("could not retrieve pubkey")
|
||||
}
|
||||
|
||||
// Decide whether to fast-sync or not
|
||||
// We don't fast-sync when the only validator is us.
|
||||
fastSync := config.FastSync
|
||||
if state.Validators.Size() == 1 {
|
||||
addr, _ := state.Validators.GetByIndex(0)
|
||||
privValAddr := privValidator.GetPubKey().Address()
|
||||
|
||||
privValAddr := pubKey.Address()
|
||||
if bytes.Equal(privValAddr, addr) {
|
||||
fastSync = false
|
||||
}
|
||||
}
|
||||
|
||||
pubKey := privValidator.GetPubKey()
|
||||
addr := pubKey.Address()
|
||||
// Log whether this node is a validator or an observer
|
||||
if state.Validators.HasAddress(addr) {
|
||||
|
||||
+2
-3
@@ -138,7 +138,7 @@ func TestNodeSetPrivValTCP(t *testing.T) {
|
||||
types.NewMockPV(),
|
||||
dialer,
|
||||
)
|
||||
privval.SignerServiceEndpointTimeoutReadWrite(100 * time.Millisecond)(pvsc)
|
||||
privval.SignerDialerEndpointTimeoutReadWrite(100 * time.Millisecond)(pvsc)
|
||||
|
||||
go func() {
|
||||
err := pvsc.Start()
|
||||
@@ -180,7 +180,7 @@ func TestNodeSetPrivValIPC(t *testing.T) {
|
||||
types.NewMockPV(),
|
||||
dialer,
|
||||
)
|
||||
privval.SignerServiceEndpointTimeoutReadWrite(100 * time.Millisecond)(pvsc)
|
||||
privval.SignerDialerEndpointTimeoutReadWrite(100 * time.Millisecond)(pvsc)
|
||||
|
||||
go func() {
|
||||
err := pvsc.Start()
|
||||
@@ -191,7 +191,6 @@ func TestNodeSetPrivValIPC(t *testing.T) {
|
||||
n, err := DefaultNewNode(config, log.TestingLogger())
|
||||
require.NoError(t, err)
|
||||
assert.IsType(t, &privval.SignerClient{}, n.PrivValidator())
|
||||
|
||||
}
|
||||
|
||||
// testFreeAddr claims a free port so we don't block on listener being ready.
|
||||
|
||||
Reference in New Issue
Block a user