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

Namespaces

 catapult
 
 catapult::validators
 

Functions

 catapult::validators::DEFINE_STATELESS_VALIDATOR (StrictAggregateCosignatures, [](const auto &notification) { utils::ArrayPointerFlagMap< Key > cosigners;cosigners.emplace(&notification.Signer, false);const auto *pCosignature=notification.CosignaturesPtr;for(auto i=0u;i< notification.CosignaturesCount;++i) { cosigners.emplace(&pCosignature->Signer, false);++pCosignature;} auto hasMissingCosigners=false;const auto *pTransaction=notification.TransactionsPtr;for(auto i=0u;i< notification.TransactionsCount;++i) { auto iter=cosigners.find(&pTransaction->Signer);if(cosigners.cend()==iter) hasMissingCosigners=true;else iter->second=true;pTransaction=AdvanceNext(pTransaction);} return std::all_of(cosigners.cbegin(), cosigners.cend(), [](const auto &pair) { return pair.second;}) ? hasMissingCosigners ? Failure_Aggregate_Missing_Cosigners :ValidationResult::Success :Failure_Aggregate_Ineligible_Cosigners;})