Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.h
Show All 19 Lines | |||||
#include <boost/multi_index/member.hpp> | #include <boost/multi_index/member.hpp> | ||||
#include <boost/multi_index/ordered_index.hpp> | #include <boost/multi_index/ordered_index.hpp> | ||||
#include <boost/multi_index_container.hpp> | #include <boost/multi_index_container.hpp> | ||||
#include <atomic> | #include <atomic> | ||||
#include <chrono> | #include <chrono> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
#include <optional> | |||||
#include <vector> | #include <vector> | ||||
class Config; | class Config; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class CScheduler; | class CScheduler; | ||||
class PeerManager; | class PeerManager; | ||||
using NodePeerManager = PeerManager; | using NodePeerManager = PeerManager; | ||||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | using QuerySet = boost::multi_index_container< | ||||
boost::multi_index::ordered_non_unique< | boost::multi_index::ordered_non_unique< | ||||
boost::multi_index::tag<query_timeout>, | boost::multi_index::tag<query_timeout>, | ||||
boost::multi_index::member<Query, TimePoint, | boost::multi_index::member<Query, TimePoint, | ||||
&Query::timeout>>>>; | &Query::timeout>>>>; | ||||
RWCollection<QuerySet> queries; | RWCollection<QuerySet> queries; | ||||
/** Data required to participate. */ | /** Data required to participate. */ | ||||
struct PeerData; | struct PeerData { | ||||
std::unique_ptr<PeerData> peerData; | std::optional<Proof> proof; | ||||
std::optional<Delegation> delegation; | |||||
}; | |||||
PeerData peerData; | |||||
CKey sessionKey; | CKey sessionKey; | ||||
/** Event loop machinery. */ | /** Event loop machinery. */ | ||||
EventLoop eventLoop; | EventLoop eventLoop; | ||||
/** Registered interfaces::Chain::Notifications handler. */ | /** Registered interfaces::Chain::Notifications handler. */ | ||||
class NotificationsHandler; | class NotificationsHandler; | ||||
std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | std::unique_ptr<interfaces::Handler> chainNotificationsHandler; | ||||
Show All 34 Lines | public: | ||||
* include in his AVAHELLO message. | * include in his AVAHELLO message. | ||||
*/ | */ | ||||
uint256 buildRemoteSighash(CNode *pfrom) const; | uint256 buildRemoteSighash(CNode *pfrom) const; | ||||
/** | /** | ||||
* Get the local proof used by this node. | * Get the local proof used by this node. | ||||
* | * | ||||
* @returns Proof for this node. | * @returns Proof for this node. | ||||
* @throws a std::runtime_error if there is no proof set for this node | * @throws a std::runtime_error if there is no proof set for this node | ||||
PiRK: The doxygen documentation is now wrong and should be fixed.
Now that the method has a more… | |||||
*/ | */ | ||||
const Proof getProof() const; | const std::optional<Proof> &getProof() const; | ||||
std::vector<avalanche::Peer> getPeers() const; | std::vector<avalanche::Peer> getPeers() const; | ||||
std::vector<NodeId> getNodeIdsForPeer(PeerId peerId) const; | std::vector<NodeId> getNodeIdsForPeer(PeerId peerId) const; | ||||
bool startEventLoop(CScheduler &scheduler); | bool startEventLoop(CScheduler &scheduler); | ||||
bool stopEventLoop(); | bool stopEventLoop(); | ||||
private: | private: | ||||
Show All 22 Lines |
The doxygen documentation is now wrong and should be fixed.
Now that the method has a more straightforward behavior, it can probably be reduced to a single line.
In D9394 I renamed it to getLocalProof, because I anticipate that getProof will at some point be needed to get any proof from the peerset or orphan proofs, to relay them.
It is not necessary to do it in this revision, but I mention it as a possible way of completely getting rid of the documentation by having all the information in the name.