Bitcoin ABC  0.28.12
P2P Digital Currency
processor.h
Go to the documentation of this file.
1 // Copyright (c) 2018-2019 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_AVALANCHE_PROCESSOR_H
6 #define BITCOIN_AVALANCHE_PROCESSOR_H
7 
8 #include <avalanche/config.h>
9 #include <avalanche/node.h>
10 #include <avalanche/proof.h>
12 #include <avalanche/protocol.h>
13 #include <avalanche/voterecord.h> // For AVALANCHE_MAX_INFLIGHT_POLL
14 #include <blockindex.h>
15 #include <blockindexcomparators.h>
16 #include <bloom.h>
17 #include <eventloop.h>
18 #include <interfaces/chain.h>
19 #include <interfaces/handler.h>
20 #include <key.h>
21 #include <net.h>
22 #include <primitives/transaction.h>
23 #include <rwcollection.h>
24 #include <util/variant.h>
25 #include <validationinterface.h>
26 
27 #include <boost/multi_index/composite_key.hpp>
28 #include <boost/multi_index/hashed_index.hpp>
29 #include <boost/multi_index/member.hpp>
30 #include <boost/multi_index/ordered_index.hpp>
31 #include <boost/multi_index_container.hpp>
32 
33 #include <atomic>
34 #include <chrono>
35 #include <cstdint>
36 #include <memory>
37 #include <unordered_map>
38 #include <variant>
39 #include <vector>
40 
41 class ArgsManager;
42 class CConnman;
43 class CNode;
44 class CScheduler;
45 class Config;
46 class PeerManager;
47 struct bilingual_str;
48 
52 static constexpr size_t AVALANCHE_MAX_ELEMENT_POLL = 16;
53 
57 static constexpr std::chrono::milliseconds AVALANCHE_DEFAULT_QUERY_TIMEOUT{
58  10000};
59 
70 
71 namespace avalanche {
72 
73 class Delegation;
74 class PeerManager;
75 class ProofRegistrationState;
76 struct VoteRecord;
77 
78 enum struct VoteStatus : uint8_t {
79  Invalid,
80  Rejected,
81  Accepted,
82  Finalized,
83  Stale,
84 };
85 
86 using AnyVoteItem =
87  std::variant<const ProofRef, const CBlockIndex *, const CTransactionRef>;
88 
92 
93 public:
95  : item(std::move(itemIn)), status(statusIn) {}
96 
97  const VoteStatus &getStatus() const { return status; }
98  const AnyVoteItem &getVoteItem() const { return item; }
99 };
100 
102  const CTxMemPool *mempool{nullptr};
103 
104 public:
106  VoteMapComparator(const CTxMemPool *mempoolIn) : mempool(mempoolIn) {}
107 
108  bool operator()(const AnyVoteItem &lhs, const AnyVoteItem &rhs) const {
109  // If the variants are of different types, sort them by variant index
110  if (lhs.index() != rhs.index()) {
111  return lhs.index() < rhs.index();
112  }
113 
114  return std::visit(
116  [](const ProofRef &lhs, const ProofRef &rhs) {
117  return ProofComparatorByScore()(lhs, rhs);
118  },
119  [](const CBlockIndex *lhs, const CBlockIndex *rhs) {
120  // Reverse ordering so we get the highest work first
121  return CBlockIndexWorkComparator()(rhs, lhs);
122  },
123  [this](const CTransactionRef &lhs, const CTransactionRef &rhs) {
124  const TxId &lhsTxId = lhs->GetId();
125  const TxId &rhsTxId = rhs->GetId();
126 
127  // If there is no mempool, sort by TxId. Note that polling
128  // for txs is currently not supported if there is no mempool
129  // so this is only a safety net.
130  if (!mempool) {
131  return lhsTxId < rhsTxId;
132  }
133 
134  LOCK(mempool->cs);
135 
136  auto lhsOptIter = mempool->GetIter(lhsTxId);
137  auto rhsOptIter = mempool->GetIter(rhsTxId);
138 
139  // If the transactions are not in the mempool, tie by TxId
140  if (!lhsOptIter && !rhsOptIter) {
141  return lhsTxId < rhsTxId;
142  }
143 
144  // If only one is in the mempool, pick that one
145  if (lhsOptIter.has_value() != rhsOptIter.has_value()) {
146  return !!lhsOptIter;
147  }
148 
149  // Both are in the mempool, select the highest fee rate
150  // including the fee deltas
152  **lhsOptIter, **rhsOptIter);
153  },
154  [](const auto &lhs, const auto &rhs) {
155  // This serves 2 purposes:
156  // - This makes sure that we don't forget to implement a
157  // comparison case when adding a new variant type.
158  // - This avoids having to write all the cross type cases
159  // which are already handled by the index sort above.
160  // Because the compiler has no way to determine that, we
161  // cannot use static assertions here without having to
162  // define the whole type matrix also.
163  assert(false);
164  // Return any bool, it's only there to make the compiler
165  // happy.
166  return false;
167  },
168  },
169  lhs, rhs);
170  }
171 };
172 using VoteMap = std::map<AnyVoteItem, VoteRecord, VoteMapComparator>;
173 
174 struct query_timeout {};
175 
176 namespace {
177  struct AvalancheTest;
178 }
179 
180 // FIXME Implement a proper notification handler for node disconnection instead
181 // of implementing the whole NetEventsInterface for a single interesting event.
182 class Processor final : public NetEventsInterface {
187 
192 
196  std::atomic<uint64_t> round;
197 
202  std::unique_ptr<PeerManager> peerManager GUARDED_BY(cs_peerManager);
203 
204  struct Query {
206  uint64_t round;
208 
215  mutable std::vector<CInv> invs;
216  };
217 
218  using QuerySet = boost::multi_index_container<
219  Query,
220  boost::multi_index::indexed_by<
221  // index by nodeid/round
222  boost::multi_index::hashed_unique<boost::multi_index::composite_key<
223  Query,
224  boost::multi_index::member<Query, NodeId, &Query::nodeid>,
225  boost::multi_index::member<Query, uint64_t, &Query::round>>>,
226  // sorted by timeout
227  boost::multi_index::ordered_non_unique<
228  boost::multi_index::tag<query_timeout>,
229  boost::multi_index::member<Query, SteadyMilliseconds,
230  &Query::timeout>>>>;
231 
233 
235  struct PeerData;
236  std::unique_ptr<PeerData> peerData;
238 
241 
245  uint32_t minQuorumScore;
247  std::atomic<bool> quorumIsEstablished{false};
248  std::atomic<bool> m_canShareLocalProof{false};
250  std::atomic<int64_t> avaproofsNodeCounter{0};
251 
253  const uint32_t staleVoteThreshold;
254  const uint32_t staleVoteFactor;
255 
257  class NotificationsHandler;
258  std::unique_ptr<interfaces::Handler> chainNotificationsHandler;
259 
261  const CBlockIndex *finalizationTip GUARDED_BY(cs_finalizationTip){nullptr};
262 
268  std::unordered_set<NodeId>
269  delayedAvahelloNodeIds GUARDED_BY(cs_delayedAvahelloNodeIds);
270 
271  struct StakingReward {
273  // Ordered list of acceptable winners, only the first is used for mining
274  std::vector<CScript> winners;
275  };
276 
278  std::unordered_map<BlockHash, StakingReward, SaltedUint256Hasher>
279  stakingRewards GUARDED_BY(cs_stakingRewards);
280 
281  const bool m_preConsensus{false};
282 
285  CScheduler &scheduler, std::unique_ptr<PeerData> peerDataIn,
286  CKey sessionKeyIn, uint32_t minQuorumTotalScoreIn,
287  double minQuorumConnectedScoreRatioIn,
288  int64_t minAvaproofsNodeCountIn, uint32_t staleVoteThresholdIn,
289  uint32_t staleVoteFactorIn, Amount stakeUtxoDustThresholdIn,
290  bool preConsensus);
291 
292 public:
293  ~Processor();
294 
295  static std::unique_ptr<Processor>
296  MakeProcessor(const ArgsManager &argsman, interfaces::Chain &chain,
298  CTxMemPool *mempoolIn, CScheduler &scheduler,
300 
301  bool addToReconcile(const AnyVoteItem &item)
308  bool reconcileOrFinalize(const ProofRef &proof)
310  bool isAccepted(const AnyVoteItem &item) const;
311  int getConfidence(const AnyVoteItem &item) const;
312 
313  bool isRecentlyFinalized(const uint256 &itemId) const
316 
317  // TODO: Refactor the API to remove the dependency on avalanche/protocol.h
318  void sendResponse(CNode *pfrom, Response response) const;
319  bool registerVotes(NodeId nodeid, const Response &response,
320  std::vector<VoteItemUpdate> &updates, int &banscore,
321  std::string &error)
324 
325  template <typename Callable>
326  auto withPeerManager(Callable &&func) const
329  return func(*peerManager);
330  }
331 
332  CPubKey getSessionPubKey() const;
339  bool sendHello(CNode *pfrom)
341  void sendDelayedAvahello()
343 
344  ProofRef getLocalProof() const;
346 
347  /*
348  * Return whether the avalanche service flag should be set.
349  */
351 
352  bool startEventLoop(CScheduler &scheduler);
353  bool stopEventLoop();
354 
357  int64_t getAvaproofsNodeCounter() const {
358  return avaproofsNodeCounter.load();
359  }
362  bool canShareLocalProof();
363 
364  bool computeStakingReward(const CBlockIndex *pindex)
366  bool eraseStakingRewardWinner(const BlockHash &prevBlockHash)
368  void cleanupStakingRewards(const int minHeight)
370  bool getStakingRewardWinners(const BlockHash &prevBlockHash,
371  std::vector<CScript> &winners) const
373  bool setStakingRewardWinners(const CBlockIndex *pprev,
374  const std::vector<CScript> &winners)
376 
377  // Implement NetEventInterface. Only FinalizeNode is of interest.
378  void InitializeNode(const ::Config &config, CNode &pnode,
379  ServiceFlags our_services) override {}
380  bool ProcessMessages(const ::Config &config, CNode *pnode,
381  std::atomic<bool> &interrupt) override {
382  return false;
383  }
384  bool SendMessages(const ::Config &config, CNode *pnode) override {
385  return false;
386  }
387 
389  void FinalizeNode(const ::Config &config,
390  const CNode &node) override LOCKS_EXCLUDED(cs_main)
392 
393 private:
394  void updatedBlockTip()
398  void runEventLoop()
402  std::vector<CInv> getInvsForNextPoll(bool forPoll = true)
404  bool sendHelloInternal(CNode *pfrom)
406  AnyVoteItem getVoteItemFromInv(const CInv &inv) const
408 
417  100, 0.0000001};
418 
431 
432  struct IsWorthPolling {
434 
435  IsWorthPolling(const Processor &_processor) : processor(_processor){};
436 
437  bool operator()(const CBlockIndex *pindex) const
439  bool operator()(const ProofRef &proof) const
441  bool operator()(const CTransactionRef &tx) const;
442  };
443  bool isWorthPolling(const AnyVoteItem &item) const
445 
448 
449  GetLocalAcceptance(const Processor &_processor)
450  : processor(_processor){};
451 
452  bool operator()(const CBlockIndex *pindex) const
454  bool operator()(const ProofRef &proof) const
456  bool operator()(const CTransactionRef &tx) const;
457  };
458  bool getLocalAcceptance(const AnyVoteItem &item) const {
459  return std::visit(GetLocalAcceptance(*this), item);
460  }
461 
462  friend struct ::avalanche::AvalancheTest;
463 };
464 
465 } // namespace avalanche
466 
467 #endif // BITCOIN_AVALANCHE_PROCESSOR_H
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:26
Definition: net.h:845
Inv(ventory) message data.
Definition: protocol.h:580
An encapsulated secp256k1 private key.
Definition: key.h:28
Information about a peer.
Definition: net.h:456
An encapsulated public key.
Definition: pubkey.h:31
RollingBloomFilter is a probabilistic "keep track of most recently inserted" set.
Definition: bloom.h:119
Simple class for background tasks that should be run periodically or once "after a while".
Definition: scheduler.h:41
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:431
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:209
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
Definition: txmempool.h:296
std::optional< txiter > GetIter(const TxId &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs)
Returns an iterator to the given txid, if found.
Definition: txmempool.cpp:558
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition: validation.h:1157
Definition: config.h:17
Interface for message handling.
Definition: net.h:794
void sendResponse(CNode *pfrom, Response response) const
Definition: processor.cpp:513
const uint32_t staleVoteThreshold
Voting parameters.
Definition: processor.h:253
std::atomic< bool > quorumIsEstablished
Definition: processor.h:247
boost::multi_index_container< Query, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::composite_key< Query, boost::multi_index::member< Query, NodeId, &Query::nodeid >, boost::multi_index::member< Query, uint64_t, &Query::round > >>, boost::multi_index::ordered_non_unique< boost::multi_index::tag< query_timeout >, boost::multi_index::member< Query, SteadyMilliseconds, &Query::timeout > >> > QuerySet
Definition: processor.h:230
std::unique_ptr< PeerManager > peerManager GUARDED_BY(cs_peerManager)
AnyVoteItem getVoteItemFromInv(const CInv &inv) const EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
Definition: processor.cpp:1165
Mutex cs_finalizedItems
Rolling bloom filter to track recently finalized inventory items of any type.
Definition: processor.h:417
bool sendHelloInternal(CNode *pfrom) EXCLUSIVE_LOCKS_REQUIRED(cs_delayedAvahelloNodeIds)
Definition: processor.cpp:685
int getConfidence(const AnyVoteItem &item) const
Definition: processor.cpp:461
bool addToReconcile(const AnyVoteItem &item) EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
Definition: processor.cpp:410
std::vector< CInv > getInvsForNextPoll(bool forPoll=true) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Definition: processor.cpp:1119
int64_t getAvaproofsNodeCounter() const
Definition: processor.h:357
RWCollection< QuerySet > queries
Definition: processor.h:232
bool ProcessMessages(const ::Config &config, CNode *pnode, std::atomic< bool > &interrupt) override
Definition: processor.h:380
bool getStakingRewardWinners(const BlockHash &prevBlockHash, std::vector< CScript > &winners) const EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
Definition: processor.cpp:925
bool registerVotes(NodeId nodeid, const Response &response, std::vector< VoteItemUpdate > &updates, int &banscore, std::string &error) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Definition: processor.cpp:520
void transactionAddedToMempool(const CTransactionRef &tx) EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
Definition: processor.cpp:1006
const CBlockIndex *finalizationTip GUARDED_BY(cs_finalizationTip)
Definition: processor.h:261
bool sendHello(CNode *pfrom) EXCLUSIVE_LOCKS_REQUIRED(!cs_delayedAvahelloNodeIds)
Send a avahello message.
Definition: processor.cpp:720
bool isRecentlyFinalized(const uint256 &itemId) const EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
Definition: processor.cpp:475
bool startEventLoop(CScheduler &scheduler)
Definition: processor.cpp:752
bool isQuorumEstablished() LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Definition: processor.cpp:782
std::atomic< uint64_t > round
Keep track of peers and queries sent.
Definition: processor.h:196
static std::unique_ptr< Processor > MakeProcessor(const ArgsManager &argsman, interfaces::Chain &chain, CConnman *connman, ChainstateManager &chainman, CTxMemPool *mempoolIn, CScheduler &scheduler, bilingual_str &error)
Definition: processor.cpp:220
EventLoop eventLoop
Event loop machinery.
Definition: processor.h:240
CTxMemPool * mempool
Definition: processor.h:186
int64_t minAvaproofsNodeCount
Definition: processor.h:249
const bool m_preConsensus
Definition: processor.h:281
Mutex cs_delayedAvahelloNodeIds
Definition: processor.h:261
void runEventLoop() EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Definition: processor.cpp:1012
bool isAvalancheServiceAvailable()
Definition: processor.h:350
Mutex cs_invalidatedBlocks
We don't need many blocks but a low false positive rate.
Definition: processor.h:415
void updatedBlockTip() EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Definition: processor.cpp:958
RWCollection< VoteMap > voteRecords
Items to run avalanche on.
Definition: processor.h:191
std::unique_ptr< interfaces::Handler > chainNotificationsHandler
Definition: processor.h:257
std::unordered_set< NodeId > delayedAvahelloNodeIds GUARDED_BY(cs_delayedAvahelloNodeIds)
A list of the nodes that did not get our proof announced via avahello yet because we had no inbound c...
uint32_t minQuorumScore
Quorum management.
Definition: processor.h:245
void FinalizeNode(const ::Config &config, const CNode &node) override LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Handle removal of a node.
Definition: processor.cpp:950
std::unordered_map< BlockHash, StakingReward, SaltedUint256Hasher > stakingRewards GUARDED_BY(cs_stakingRewards)
std::atomic< bool > m_canShareLocalProof
Definition: processor.h:248
bool isAccepted(const AnyVoteItem &item) const
Definition: processor.cpp:447
ProofRef getLocalProof() const
Definition: processor.cpp:742
void InitializeNode(const ::Config &config, CNode &pnode, ServiceFlags our_services) override
Definition: processor.h:378
bool reconcileOrFinalize(const ProofRef &proof) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Wrapper around the addToReconcile for proofs that adds back the finalization flag to the peer if it i...
Definition: processor.cpp:428
const uint32_t staleVoteFactor
Definition: processor.h:254
void sendDelayedAvahello() EXCLUSIVE_LOCKS_REQUIRED(!cs_delayedAvahelloNodeIds)
Definition: processor.cpp:725
std::unique_ptr< PeerData > peerData
Definition: processor.h:235
bool eraseStakingRewardWinner(const BlockHash &prevBlockHash) EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
Definition: processor.cpp:908
CConnman * connman
Definition: processor.h:184
bool setStakingRewardWinners(const CBlockIndex *pprev, const std::vector< CScript > &winners) EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
Definition: processor.cpp:937
bool isWorthPolling(const AnyVoteItem &item) const EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
Definition: processor.cpp:1238
CPubKey getSessionPubKey() const
Definition: processor.cpp:681
auto withPeerManager(Callable &&func) const EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
Definition: processor.h:326
Processor(Config avaconfig, interfaces::Chain &chain, CConnman *connmanIn, ChainstateManager &chainman, CTxMemPool *mempoolIn, CScheduler &scheduler, std::unique_ptr< PeerData > peerDataIn, CKey sessionKeyIn, uint32_t minQuorumTotalScoreIn, double minQuorumConnectedScoreRatioIn, int64_t minAvaproofsNodeCountIn, uint32_t staleVoteThresholdIn, uint32_t staleVoteFactorIn, Amount stakeUtxoDustThresholdIn, bool preConsensus)
Definition: processor.cpp:144
ChainstateManager & chainman
Definition: processor.h:185
std::atomic< int64_t > avaproofsNodeCounter
Definition: processor.h:250
bool SendMessages(const ::Config &config, CNode *pnode) override
Definition: processor.h:384
bool computeStakingReward(const CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager
Definition: processor.cpp:876
ProofRegistrationState getLocalProofRegistrationState() const
Definition: processor.cpp:746
CRollingBloomFilter finalizedItems GUARDED_BY(cs_finalizedItems)
Definition: processor.h:429
void cleanupStakingRewards(const int minHeight) EXCLUSIVE_LOCKS_REQUIRED(!cs_stakingRewards)
Definition: processor.cpp:913
void clearTimedoutRequests() EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
Definition: processor.cpp:1080
Mutex cs_peerManager
Keep track of the peers and associated infos.
Definition: processor.h:201
bool getLocalAcceptance(const AnyVoteItem &item) const
Definition: processor.h:458
void avaproofsSent(NodeId nodeid) LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(!cs_peerManager)
Definition: processor.cpp:761
double minQuorumConnectedScoreRatio
Definition: processor.h:246
void clearFinalizedItems() EXCLUSIVE_LOCKS_REQUIRED(!cs_finalizedItems)
Definition: processor.cpp:479
VoteItemUpdate(AnyVoteItem itemIn, VoteStatus statusIn)
Definition: processor.h:94
const VoteStatus & getStatus() const
Definition: processor.h:97
const AnyVoteItem & getVoteItem() const
Definition: processor.h:98
VoteMapComparator(const CTxMemPool *mempoolIn)
Definition: processor.h:106
const CTxMemPool * mempool
Definition: processor.h:102
bool operator()(const AnyVoteItem &lhs, const AnyVoteItem &rhs) const
Definition: processor.h:108
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
Definition: chain.h:123
256-bit opaque blob.
Definition: uint256.h:127
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
Definition: cs_main.cpp:7
std::map< AnyVoteItem, VoteRecord, VoteMapComparator > VoteMap
Definition: processor.h:172
std::variant< const ProofRef, const CBlockIndex *, const CTransactionRef > AnyVoteItem
Definition: processor.h:87
Definition: init.h:28
Implement std::hash so RCUPtr can be used as a key for maps or sets.
Definition: rcu.h:257
int64_t NodeId
Definition: nodeid.h:10
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:315
Response response
Definition: processor.cpp:490
static constexpr std::chrono::milliseconds AVALANCHE_DEFAULT_QUERY_TIMEOUT
How long before we consider that a query timed out.
Definition: processor.h:57
static constexpr size_t AVALANCHE_MAX_ELEMENT_POLL
Maximum item that can be polled at once.
Definition: processor.h:52
static constexpr uint32_t AVALANCHE_FINALIZED_ITEMS_FILTER_NUM_ELEMENTS
The size of the finalized items filter.
Definition: processor.h:68
ServiceFlags
nServices flags.
Definition: protocol.h:335
Definition: amount.h:19
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
Sort by feerate of entry (modfee/vsize) in descending order.
Definition: txmempool.h:91
A TxId is the identifier of a transaction.
Definition: txid.h:14
bool operator()(const CBlockIndex *pindex) const LOCKS_EXCLUDED(cs_main)
Definition: processor.cpp:1243
GetLocalAcceptance(const Processor &_processor)
Definition: processor.h:449
IsWorthPolling(const Processor &_processor)
Definition: processor.h:435
bool operator()(const CBlockIndex *pindex) const LOCKS_EXCLUDED(cs_main)
Definition: processor.cpp:1183
SteadyMilliseconds timeout
Definition: processor.h:207
std::vector< CInv > invs
We declare this as mutable so it can be modified in the multi_index.
Definition: processor.h:215
std::vector< CScript > winners
Definition: processor.h:274
Compare proofs by score, then by id in case of equality.
Bilingual messages:
Definition: translation.h:17
#define LOCK(cs)
Definition: sync.h:306
bool error(const char *fmt, const Args &...args)
Definition: system.h:45
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Definition: threadsafety.h:56
#define LOCKS_EXCLUDED(...)
Definition: threadsafety.h:55
std::chrono::time_point< std::chrono::steady_clock, std::chrono::milliseconds > SteadyMilliseconds
Definition: time.h:31
assert(!tx.IsCoinBase())
static constexpr int AVALANCHE_MAX_INFLIGHT_POLL
How many inflight requests can exist for one item.
Definition: voterecord.h:40