check that the name is valid in register/renewal (we already do this implicitly through the check() method, but we should do it explicitly for clarity)

This commit is contained in:
Jude Nelson
2018-04-23 16:16:49 -04:00
parent ff4488eed5
commit 9513f5d672

View File

@@ -318,6 +318,11 @@ def check_register( state_engine, nameop, block_id, checked_ops ):
log.warning("No recipient script given")
return False
# name must be well-formed
if not is_name_valid( name ):
log.warning("Malformed name '%s'" % name)
return False
epoch_features = get_epoch_features(block_id)
name_fee = None
@@ -560,6 +565,11 @@ def check_renewal( state_engine, nameop, block_id, checked_ops ):
log.warning("No recipient given")
return False
# name must be well-formed
if not is_name_valid( name ):
log.warning("Malformed name '%s'" % name)
return False
# pre F-day 2017, on renewal, the sender and recipient must be the same
# post F-day 2017, the recipient and sender can differ
if sender != recipient: