|
|
@ -36,17 +36,18 @@ func resetAll(cmd *cobra.Command, args []string) { |
|
|
|
// XXX: this is totally unsafe.
|
|
|
|
// it's only suitable for testnets.
|
|
|
|
func resetPrivValidator(cmd *cobra.Command, args []string) { |
|
|
|
ResetPrivValidator(config, log) |
|
|
|
resetPrivValidatorLocal(config, log) |
|
|
|
} |
|
|
|
|
|
|
|
// Exported so other CLI tools can use it
|
|
|
|
func ResetAll(c *viper.Viper, l log15.Logger) { |
|
|
|
ResetPrivValidator(c, l) |
|
|
|
os.RemoveAll(c.GetString("db_dir")) |
|
|
|
resetPrivValidatorLocal(c, l) |
|
|
|
dataDir := c.GetString("db_dir") |
|
|
|
os.RemoveAll(dataDir) |
|
|
|
l.Notice("Removed all data", "dir", dataDir) |
|
|
|
} |
|
|
|
|
|
|
|
func ResetPrivValidator(c *viper.Viper, l log15.Logger) { |
|
|
|
func resetPrivValidatorLocal(c *viper.Viper, l log15.Logger) { |
|
|
|
|
|
|
|
// Get PrivValidator
|
|
|
|
var privValidator *types.PrivValidator |
|
|
|