Skip to content

Commit

Permalink
Update Networking/Sources/Networking/Peer.swift
Browse files Browse the repository at this point in the history
Co-authored-by: Xiliang Chen <[email protected]>
  • Loading branch information
MacOMNI and xlc authored Nov 5, 2024
1 parent 26a4da3 commit 7d832c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Networking/Sources/Networking/Peer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ final class PeerImpl<Handler: StreamHandler>: Sendable {

func reconnect(to address: NetAddr, role: PeerRole) throws {
let state = reconnectStates.read { reconnectStates in
reconnectStates[address] ?? ReconnectState(attempt: 0, delay: 1)
reconnectStates[address] ?? .init()
}
if state.attempt < reconnectMaxRetryAttempts {
reconnectStates.write { reconnectStates in
Expand Down

0 comments on commit 7d832c0

Please sign in to comment.