forked from stellar/stellar-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInferredQuorum.h
33 lines (29 loc) · 1.08 KB
/
InferredQuorum.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
// Copyright 2016 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
#include "crypto/SecretKey.h"
#include "herder/QuorumTracker.h"
#include "main/Config.h"
#include "overlay/StellarXDR.h"
#include "util/HashOfHash.h"
#include <string>
#include <unordered_map>
namespace stellar
{
struct InferredQuorum
{
InferredQuorum();
InferredQuorum(QuorumTracker::QuorumMap const& qmap);
std::unordered_map<Hash, SCPQuorumSet> mQsets;
std::unordered_map<PublicKey, std::vector<Hash>> mQsetHashes;
std::unordered_map<PublicKey, size_t> mPubKeys;
void noteSCPHistory(SCPHistoryEntry const& hist);
void noteQset(SCPQuorumSet const& qset);
void noteQsetHash(PublicKey const& pk, Hash const& hash);
void notePubKey(PublicKey const& pk);
std::string toString(Config const& cfg) const;
void writeQuorumGraph(Config const& cfg, std::ostream& out) const;
QuorumTracker::QuorumMap getQuorumMap() const;
};
}