|
|
@ -73,6 +73,10 @@ func (c *vanityGenCommand) Execute(_ *cobra.Command, _ []string) error {
|
|
|
|
if len(prefixBytes) < 2 {
|
|
|
|
if len(prefixBytes) < 2 {
|
|
|
|
return fmt.Errorf("prefix must be at least 2 bytes")
|
|
|
|
return fmt.Errorf("prefix must be at least 2 bytes")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(prefixBytes) > 8 {
|
|
|
|
|
|
|
|
return fmt.Errorf("prefix too long, unlikely to find a key " +
|
|
|
|
|
|
|
|
"within billions of years")
|
|
|
|
|
|
|
|
}
|
|
|
|
if !(prefixBytes[0] == 0x02 || prefixBytes[0] == 0x03) {
|
|
|
|
if !(prefixBytes[0] == 0x02 || prefixBytes[0] == 0x03) {
|
|
|
|
return fmt.Errorf("prefix must start with 02 or 03 because " +
|
|
|
|
return fmt.Errorf("prefix must start with 02 or 03 because " +
|
|
|
|
"it's an EC public key")
|
|
|
|
"it's an EC public key")
|
|
|
|