| catapult::observers::DEFINE_OBSERVER (AccountLink, model::RemoteAccountLinkNotification, [](const auto ¬ification, 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);} }) |