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

Namespaces

 catapult
 
 catapult::observers
 

Functions

 catapult::observers::DEFINE_OBSERVER (AccountLink, model::RemoteAccountLinkNotification, [](const auto &notification, const auto &context) { auto &cache=context.Cache.template sub< cache::AccountStateCache >();auto mainAccountStateIter=cache.find(notification.MainAccountKey);auto &mainAccountState=mainAccountStateIter.get();auto remoteAccountStateIter=cache.find(notification.RemoteAccountKey);auto &remoteAccountState=remoteAccountStateIter.get();if(ShouldLink(notification.LinkAction, context.Mode)) { SetLink(mainAccountState, notification.RemoteAccountKey, state::AccountType::Main);SetLink(remoteAccountState, notification.MainAccountKey, state::AccountType::Remote);} else { SetLink(mainAccountState, Key(), state::AccountType::Unlinked);SetLink(remoteAccountState, Key(), state::AccountType::Remote_Unlinked);} })