Skip to content

Commit

Permalink
fix(sync): peer status set to known on sucessfull handshaking
Browse files Browse the repository at this point in the history
  • Loading branch information
themantre committed Oct 24, 2023
1 parent 57af41e commit f81ac81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sync/handler_hello.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (handler *helloHandler) ParseMessage(m message.Message, initiator peer.ID)
}

handler.peerSet.UpdateHeight(initiator, msg.Height, msg.BlockHash)
handler.peerSet.UpdateStatus(initiator, peerset.StatusCodeConnected)
handler.peerSet.UpdateStatus(initiator, peerset.StatusCodeKnown)

response := message.NewHelloAckMessage(message.ResponseCodeOK, "Ok")
return handler.acknowledge(response, initiator)
Expand Down
2 changes: 1 addition & 1 deletion sync/handler_hello_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestParsingHelloMessages(t *testing.T) {
p := td.sync.peerSet.GetPeer(pid)

pub := valKey.PublicKey()
assert.Equal(t, p.Status, peerset.StatusCodeConnected)
assert.Equal(t, p.Status, peerset.StatusCodeKnown)
assert.Equal(t, p.Agent, version.Agent())
assert.Equal(t, p.Moniker, "kitty")
assert.Contains(t, p.ConsensusKeys, pub)
Expand Down

0 comments on commit f81ac81

Please sign in to comment.