CatapultServer  v0.5.0.1 (Elephant)
NamespaceAvailabilityValidator.cpp File Reference
Include dependency graph for NamespaceAvailabilityValidator.cpp:

Namespaces

 catapult
 
 catapult::validators
 

Functions

 catapult::validators::DEFINE_STATEFUL_VALIDATOR (RootNamespaceAvailability, [](const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::NamespaceCache >();auto height=context.Height;if(Height(1) !=height &&Eternal_Artifact_Duration==notification.Duration) return Failure_Namespace_Eternal_After_Nemesis_Block;if(!cache.contains(notification.NamespaceId)) return ValidationResult::Success;auto namespaceIter=cache.find(notification.NamespaceId);const auto &root=namespaceIter.get().root();if(IsEternal(root.lifetime())||Eternal_Artifact_Duration==notification.Duration) return Failure_Namespace_Invalid_Duration;if(!root.lifetime().isActiveOrGracePeriod(height)) return ValidationResult::Success;return root.owner()==notification.Signer ? ValidationResult::Success :Failure_Namespace_Owner_Conflict;})