This commit is contained in:
Matt Joiner 2018-04-12 23:34:31 +10:00
parent 0290a1610a
commit e9386d1016
2 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,12 @@ func TestClientDefault(t *testing.T) {
cl.Close() cl.Close()
} }
func TestClientNilConfig(t *testing.T) {
cl, err := NewClient(nil)
require.NoError(t, err)
cl.Close()
}
func TestBoltPieceCompletionClosedWhenClientClosed(t *testing.T) { func TestBoltPieceCompletionClosedWhenClientClosed(t *testing.T) {
cfg := TestingConfig() cfg := TestingConfig()
pc, err := storage.NewBoltPieceCompletion(cfg.DataDir) pc, err := storage.NewBoltPieceCompletion(cfg.DataDir)

View File

@ -161,6 +161,9 @@ func (cfg *Config) setDefaults() {
if cfg.DhtStartingNodes == nil { if cfg.DhtStartingNodes == nil {
cfg.DhtStartingNodes = dht.GlobalBootstrapAddrs cfg.DhtStartingNodes = dht.GlobalBootstrapAddrs
} }
if cfg.ListenHost == nil {
cfg.ListenHost = func(string) string { return "" }
}
} }
type EncryptionPolicy struct { type EncryptionPolicy struct {