Browse Source

Add is_valid_taddr, which needs to be generalized for other chains

master
Jonathan "Duke" Leto 6 years ago
parent
commit
e5573fe9e6
  1. 13
      lib/Hush/Util.pm

13
lib/Hush/Util.pm

@ -6,6 +6,7 @@ use Carp qw/longmess/;
our @EXPORT_OK = qw/
barf timing now
is_valid_zaddr
is_valid_taddr
is_valid_privkey
/;
use Time::HiRes qw/gettimeofday tv_interval/;
@ -30,6 +31,18 @@ sub is_valid_zaddr {
return 0;
}
}
# valid for HUSH+ZEC, we need tables for other prefixes
sub is_valid_taddr {
my ($t) = @_;
# TODO: only base58 is valid
if ($t =~ m/^t1[a-z0-9]{35}$/i) {
return 1;
} else {
return 0;
}
}
# we never look at taddr privkeys
# valid for HUSH+ZEC, we need tables for other prefixes
sub is_valid_privkey {

Loading…
Cancel
Save