CatapultServer  v0.5.0.1 (Elephant)
RemoteTimeSyncApi.h
Go to the documentation of this file.
1 
21 #pragma once
23 #include "catapult/thread/Future.h"
24 
25 namespace catapult { namespace ionet { class PacketIo; } }
26 
27 namespace catapult { namespace api {
28 
31  public:
32  virtual ~RemoteTimeSyncApi() = default;
33 
34  public:
37  };
38 
40  std::unique_ptr<RemoteTimeSyncApi> CreateRemoteTimeSyncApi(ionet::PacketIo& io);
41 }}
catapult::validators::DEFINE_STATEFUL_VALIDATOR
DEFINE_STATEFUL_VALIDATOR(EligibleHarvester, [](const auto &notification, const auto &context) { cache::ImportanceView view(context.Cache.template sub< cache::AccountStateCache >());return view.canHarvest(notification.Signer, context.Height) ? ValidationResult::Success :Failure_Core_Block_Harvester_Ineligible;})
catapult::api::RemoteTimeSyncApi::networkTime
virtual thread::future< timesync::CommunicationTimestamps > networkTime() const =0
Gets communication timestamps from a remote node.
CommunicationTimestamps.h
catapult::state::IsRemote
bool IsRemote(AccountType accountType)
Returns true if accountType corresponds to a remote account.
Definition: AccountState.cpp:41
ValidatorContext.h
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
TimeSyncPackets.h
Packet_Type
static constexpr auto Packet_Type
Definition: RemoteTimeSyncApi.cpp:33
Friendly_Name
static constexpr auto Friendly_Name
Definition: RemoteTimeSyncApi.cpp:34
catapult::api::RemoteTimeSyncApi
An api for retrieving communication timestamps from a remote node.
Definition: RemoteTimeSyncApi.h:30
catapult::api::RemoteTimeSyncApi::~RemoteTimeSyncApi
virtual ~RemoteTimeSyncApi()=default
catapult::ionet::PacketIo
An interface for reading and writing packets.
Definition: PacketIo.h:31
catapult::thread::future
Provides a way to access the result of an asynchronous operation.
Definition: Future.h:29
m_impl
RemoteRequestDispatcher m_impl
Definition: RemoteTimeSyncApi.cpp:68
AccountStateCache.h
AccountState.h
catapult::validators::ValidationResult::Success
Validation succeeded.
RemoteTimeSyncApi.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::api::CreateRemoteTimeSyncApi
std::unique_ptr< RemoteTimeSyncApi > CreateRemoteTimeSyncApi(ionet::PacketIo &io)
Creates a time sync api for interacting with a remote node with the specified io.
Definition: RemoteTimeSyncApi.cpp:72
Future.h
RemoteRequestDispatcher.h