Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Jul 27, 2023
1 parent 90bb4ee commit 82fe1fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func BootstrapConfigWithPeers(pis []peer.AddrInfo, options ...func(*BootstrapCon
// WithBackupPeers configures functions to load and save backup bootstrap peers.
func WithBackupPeers(load func(context.Context) []peer.AddrInfo, save func(context.Context, []peer.AddrInfo)) func(*BootstrapConfig) {
if save == nil && load != nil || save != nil && load == nil {
panic("both save an load backup bootstrap peers functions must be defined")
panic("both load and save backup bootstrap peers functions must be defined")
}
return func(cfg *BootstrapConfig) {
cfg.LoadBackupBootstrapPeers = load
Expand All @@ -103,7 +103,7 @@ func WithBackupPeers(load func(context.Context) []peer.AddrInfo, save func(conte
func Bootstrap(id peer.ID, host host.Host, rt routing.Routing, cfg BootstrapConfig) (io.Closer, error) {
if cfg.LoadBackupBootstrapPeers == nil || cfg.SaveBackupBootstrapPeers == nil {
if cfg.LoadBackupBootstrapPeers != nil || cfg.SaveBackupBootstrapPeers != nil {
return nil, errors.New("LoadBackupBootstrapPeers and SaveBackupBootstrapPeers must both be defeind or nil")
return nil, errors.New("LoadBackupBootstrapPeers and SaveBackupBootstrapPeers must both be defined or nil")
}
}

Expand Down

0 comments on commit 82fe1fb

Please sign in to comment.