|
|
|
@ -5,7 +5,6 @@ package nodeconfig |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"crypto/ecdsa" |
|
|
|
|
"errors" |
|
|
|
|
"fmt" |
|
|
|
|
"sync" |
|
|
|
|
|
|
|
|
@ -111,18 +110,6 @@ func GetShardConfig(shardID uint32) *ConfigType { |
|
|
|
|
return &shardConfigs[shardID] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// SetConfigs set ConfigType in the right index.
|
|
|
|
|
func SetConfigs(config ConfigType, shardID uint32) error { |
|
|
|
|
onceForConfigs.Do(func() { |
|
|
|
|
shardConfigs = make([]ConfigType, MaxShards) |
|
|
|
|
}) |
|
|
|
|
if int(shardID) >= cap(shardConfigs) { |
|
|
|
|
return errors.New("Failed to set ConfigType") |
|
|
|
|
} |
|
|
|
|
shardConfigs[int(shardID)] = config |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GetDefaultConfig returns default config.
|
|
|
|
|
func GetDefaultConfig() *ConfigType { |
|
|
|
|
return &defaultConfig |
|
|
|
|