Bitcoin ABC  0.22.12
P2P Digital Currency
chain.cpp
Go to the documentation of this file.
1 // Copyright (c) 2018-2019 The Bitcoin Core 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 #include <interfaces/chain.h>
6 
7 #include <blockdb.h>
8 #include <chain.h>
9 #include <chainparams.h>
10 #include <interfaces/handler.h>
11 #include <interfaces/wallet.h>
12 #include <net.h>
13 #include <net_processing.h>
14 #include <node/coin.h>
15 #include <node/context.h>
16 #include <node/transaction.h>
17 #include <node/ui_interface.h>
18 #include <policy/mempool.h>
19 #include <policy/policy.h>
20 #include <policy/settings.h>
21 #include <primitives/block.h>
22 #include <primitives/blockhash.h>
23 #include <rpc/protocol.h>
24 #include <rpc/server.h>
25 #include <shutdown.h>
26 #include <sync.h>
27 #include <timedata.h>
28 #include <txmempool.h>
29 #include <univalue.h>
30 #include <util/system.h>
31 #include <validation.h>
32 #include <validationinterface.h>
33 
34 #include <utility>
35 
36 namespace interfaces {
37 namespace {
38 
39  bool FillBlock(const CBlockIndex *index, const FoundBlock &block,
41  if (!index) {
42  return false;
43  }
44  if (block.m_hash) {
45  *block.m_hash = index->GetBlockHash();
46  }
47  if (block.m_height) {
48  *block.m_height = index->nHeight;
49  }
50  if (block.m_time) {
51  *block.m_time = index->GetBlockTime();
52  }
53  if (block.m_max_time) {
54  *block.m_max_time = index->GetBlockTimeMax();
55  }
56  if (block.m_mtp_time) {
57  *block.m_mtp_time = index->GetMedianTimePast();
58  }
59  if (block.m_data) {
60  REVERSE_LOCK(lock);
61  if (!ReadBlockFromDisk(*block.m_data, index,
62  Params().GetConsensus())) {
63  block.m_data->SetNull();
64  }
65  }
66  return true;
67  }
68 
69  class NotificationsProxy : public CValidationInterface {
70  public:
71  explicit NotificationsProxy(
72  std::shared_ptr<Chain::Notifications> notifications)
73  : m_notifications(std::move(notifications)) {}
74  virtual ~NotificationsProxy() = default;
75  void TransactionAddedToMempool(const CTransactionRef &tx) override {
76  m_notifications->transactionAddedToMempool(tx);
77  }
78  void TransactionRemovedFromMempool(const CTransactionRef &tx) override {
79  m_notifications->transactionRemovedFromMempool(tx);
80  }
81  void BlockConnected(const std::shared_ptr<const CBlock> &block,
82  const CBlockIndex *index) override {
83  m_notifications->blockConnected(*block, index->nHeight);
84  }
85  void BlockDisconnected(const std::shared_ptr<const CBlock> &block,
86  const CBlockIndex *index) override {
87  m_notifications->blockDisconnected(*block, index->nHeight);
88  }
89  void UpdatedBlockTip(const CBlockIndex *index,
90  const CBlockIndex *fork_index,
91  bool is_ibd) override {
92  m_notifications->updatedBlockTip();
93  }
94  void ChainStateFlushed(const CBlockLocator &locator) override {
95  m_notifications->chainStateFlushed(locator);
96  }
97  std::shared_ptr<Chain::Notifications> m_notifications;
98  };
99 
100  class NotificationsHandlerImpl : public Handler {
101  public:
102  explicit NotificationsHandlerImpl(
103  std::shared_ptr<Chain::Notifications> notifications)
104  : m_proxy(std::make_shared<NotificationsProxy>(
105  std::move(notifications))) {
107  }
108  ~NotificationsHandlerImpl() override { disconnect(); }
109  void disconnect() override {
110  if (m_proxy) {
112  m_proxy.reset();
113  }
114  }
115  std::shared_ptr<NotificationsProxy> m_proxy;
116  };
117 
118  class RpcHandlerImpl : public Handler {
119  public:
120  explicit RpcHandlerImpl(const CRPCCommand &command)
121  : m_command(command), m_wrapped_command(&command) {
122  m_command.actor = [this](Config &config,
123  const JSONRPCRequest &request,
124  UniValue &result, bool last_handler) {
125  if (!m_wrapped_command) {
126  return false;
127  }
128  try {
129  return m_wrapped_command->actor(config, request, result,
130  last_handler);
131  } catch (const UniValue &e) {
132  // If this is not the last handler and a wallet not found
133  // exception was thrown, return false so the next handler
134  // can try to handle the request. Otherwise, reraise the
135  // exception.
136  if (!last_handler) {
137  const UniValue &code = e["code"];
138  if (code.isNum() &&
139  code.get_int() == RPC_WALLET_NOT_FOUND) {
140  return false;
141  }
142  }
143  throw;
144  }
145  };
147  }
148 
149  void disconnect() override final {
150  if (m_wrapped_command) {
151  m_wrapped_command = nullptr;
153  }
154  }
155 
156  ~RpcHandlerImpl() override { disconnect(); }
157 
160  };
161 
162  class ChainImpl : public Chain {
163  public:
164  explicit ChainImpl(NodeContext &node, const CChainParams &params)
165  : m_node(node), m_params(params) {}
166  std::optional<int> getHeight() override {
167  LOCK(::cs_main);
168  int height = ::ChainActive().Height();
169  if (height >= 0) {
170  return height;
171  }
172  return std::nullopt;
173  }
174  std::optional<int> getBlockHeight(const BlockHash &hash) override {
175  LOCK(::cs_main);
176  CBlockIndex *block = LookupBlockIndex(hash);
177  if (block && ::ChainActive().Contains(block)) {
178  return block->nHeight;
179  }
180  return std::nullopt;
181  }
182  BlockHash getBlockHash(int height) override {
183  LOCK(::cs_main);
184  CBlockIndex *block = ::ChainActive()[height];
185  assert(block);
186  return block->GetBlockHash();
187  }
188  bool haveBlockOnDisk(int height) override {
189  LOCK(cs_main);
190  CBlockIndex *block = ::ChainActive()[height];
191  return block && (block->nStatus.hasData() != 0) && block->nTx > 0;
192  }
193  std::optional<int>
194  findFirstBlockWithTimeAndHeight(int64_t time, int height,
195  BlockHash *hash) override {
196  LOCK(cs_main);
197  CBlockIndex *block =
198  ::ChainActive().FindEarliestAtLeast(time, height);
199  if (block) {
200  if (hash) {
201  *hash = block->GetBlockHash();
202  }
203  return block->nHeight;
204  }
205  return std::nullopt;
206  }
207  CBlockLocator getTipLocator() override {
208  LOCK(cs_main);
210  }
211  bool contextualCheckTransactionForCurrentBlock(
212  const CTransaction &tx, TxValidationState &state) override {
213  LOCK(cs_main);
215  m_params.GetConsensus(), tx, state);
216  }
217  std::optional<int>
218  findLocatorFork(const CBlockLocator &locator) override {
219  LOCK(cs_main);
220  if (CBlockIndex *fork =
221  FindForkInGlobalIndex(::ChainActive(), locator)) {
222  return fork->nHeight;
223  }
224  return std::nullopt;
225  }
226  bool findBlock(const BlockHash &hash,
227  const FoundBlock &block) override {
228  WAIT_LOCK(cs_main, lock);
229  return FillBlock(LookupBlockIndex(hash), block, lock);
230  }
231  bool findFirstBlockWithTimeAndHeight(int64_t min_time, int min_height,
232  const FoundBlock &block) override {
233  WAIT_LOCK(cs_main, lock);
234  return FillBlock(
235  ChainActive().FindEarliestAtLeast(min_time, min_height), block,
236  lock);
237  }
238  bool findNextBlock(const BlockHash &block_hash, int block_height,
239  const FoundBlock &next, bool *reorg) override {
240  WAIT_LOCK(cs_main, lock);
241  CBlockIndex *block = ChainActive()[block_height];
242  if (block && block->GetBlockHash() != block_hash) {
243  block = nullptr;
244  }
245  if (reorg) {
246  *reorg = !block;
247  }
248  return FillBlock(block ? ChainActive()[block_height + 1] : nullptr,
249  next, lock);
250  }
251  bool findAncestorByHeight(const BlockHash &block_hash,
252  int ancestor_height,
253  const FoundBlock &ancestor_out) override {
254  WAIT_LOCK(cs_main, lock);
255  if (const CBlockIndex *block = LookupBlockIndex(block_hash)) {
256  if (const CBlockIndex *ancestor =
257  block->GetAncestor(ancestor_height)) {
258  return FillBlock(ancestor, ancestor_out, lock);
259  }
260  }
261  return FillBlock(nullptr, ancestor_out, lock);
262  }
263  bool findAncestorByHash(const BlockHash &block_hash,
264  const BlockHash &ancestor_hash,
265  const FoundBlock &ancestor_out) override {
266  WAIT_LOCK(cs_main, lock);
267  const CBlockIndex *block = LookupBlockIndex(block_hash);
268  const CBlockIndex *ancestor = LookupBlockIndex(ancestor_hash);
269  if (block && ancestor &&
270  block->GetAncestor(ancestor->nHeight) != ancestor) {
271  ancestor = nullptr;
272  }
273  return FillBlock(ancestor, ancestor_out, lock);
274  }
275  bool findCommonAncestor(const BlockHash &block_hash1,
276  const BlockHash &block_hash2,
277  const FoundBlock &ancestor_out,
278  const FoundBlock &block1_out,
279  const FoundBlock &block2_out) override {
280  WAIT_LOCK(cs_main, lock);
281  const CBlockIndex *block1 = LookupBlockIndex(block_hash1);
282  const CBlockIndex *block2 = LookupBlockIndex(block_hash2);
283  const CBlockIndex *ancestor =
284  block1 && block2 ? LastCommonAncestor(block1, block2) : nullptr;
285  // Using & instead of && below to avoid short circuiting and leaving
286  // output uninitialized.
287  return FillBlock(ancestor, ancestor_out, lock) &
288  FillBlock(block1, block1_out, lock) &
289  FillBlock(block2, block2_out, lock);
290  }
291  void findCoins(std::map<COutPoint, Coin> &coins) override {
292  return FindCoins(m_node, coins);
293  }
294  double guessVerificationProgress(const BlockHash &block_hash) override {
295  LOCK(cs_main);
296  return GuessVerificationProgress(Params().TxData(),
297  LookupBlockIndex(block_hash));
298  }
299  bool hasBlocks(const BlockHash &block_hash, int min_height,
300  std::optional<int> max_height) override {
301  // hasBlocks returns true if all ancestors of block_hash in
302  // specified range have block data (are not pruned), false if any
303  // ancestors in specified range are missing data.
304  //
305  // For simplicity and robustness, min_height and max_height are only
306  // used to limit the range, and passing min_height that's too low or
307  // max_height that's too high will not crash or change the result.
308  LOCK(::cs_main);
309  if (CBlockIndex *block = LookupBlockIndex(block_hash)) {
310  if (max_height && block->nHeight >= *max_height) {
311  block = block->GetAncestor(*max_height);
312  }
313  for (; block->nStatus.hasData(); block = block->pprev) {
314  // Check pprev to not segfault if min_height is too low
315  if (block->nHeight <= min_height || !block->pprev) {
316  return true;
317  }
318  }
319  }
320  return false;
321  }
322  bool hasDescendantsInMempool(const TxId &txid) override {
323  LOCK(::g_mempool.cs);
324  auto it = ::g_mempool.GetIter(txid);
325  return it && (*it)->GetCountWithDescendants() > 1;
326  }
327  bool broadcastTransaction(const Config &config,
328  const CTransactionRef &tx,
329  const Amount &max_tx_fee, bool relay,
330  std::string &err_string) override {
332  m_node, config, tx, err_string, max_tx_fee, relay,
333  /*wait_callback*/ false);
334  // Chain clients only care about failures to accept the tx to the
335  // mempool. Disregard non-mempool related failures. Note: this will
336  // need to be updated if BroadcastTransactions() is updated to
337  // return other non-mempool failures that Chain clients do not need
338  // to know about.
339  return err == TransactionError::OK;
340  }
341  void getTransactionAncestry(const TxId &txid, size_t &ancestors,
342  size_t &descendants) override {
343  ::g_mempool.GetTransactionAncestry(txid, ancestors, descendants);
344  }
345  void getPackageLimits(size_t &limit_ancestor_count,
346  size_t &limit_descendant_count) override {
347  limit_ancestor_count = size_t(
348  std::max<int64_t>(1, gArgs.GetArg("-limitancestorcount",
350  limit_descendant_count = size_t(
351  std::max<int64_t>(1, gArgs.GetArg("-limitdescendantcount",
353  }
354  bool checkChainLimits(const CTransactionRef &tx) override {
355  LockPoints lp;
356  CTxMemPoolEntry entry(tx, Amount(), 0, 0, false, 0, lp);
357  CTxMemPool::setEntries ancestors;
358  auto limit_ancestor_count =
359  gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT);
360  auto limit_ancestor_size =
361  gArgs.GetArg("-limitancestorsize",
363  1000;
364  auto limit_descendant_count =
365  gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT);
366  auto limit_descendant_size =
367  gArgs.GetArg("-limitdescendantsize",
369  1000;
370  std::string unused_error_string;
371  LOCK(::g_mempool.cs);
373  entry, ancestors, limit_ancestor_count, limit_ancestor_size,
374  limit_descendant_count, limit_descendant_size,
375  unused_error_string);
376  }
377  CFeeRate estimateFee() const override {
379  }
380  CFeeRate relayMinFee() override { return ::minRelayTxFee; }
381  CFeeRate relayDustFee() override { return ::dustRelayFee; }
382  bool havePruned() override {
383  LOCK(cs_main);
385  }
386  bool isReadyToBroadcast() override {
387  return !::fImporting && !::fReindex && !isInitialBlockDownload();
388  }
389  bool isInitialBlockDownload() override {
391  }
392  bool shutdownRequested() override { return ShutdownRequested(); }
393  int64_t getAdjustedTime() override { return GetAdjustedTime(); }
394  void initMessage(const std::string &message) override {
395  ::uiInterface.InitMessage(message);
396  }
397  void initWarning(const bilingual_str &message) override {
398  InitWarning(message);
399  }
400  void initError(const bilingual_str &message) override {
401  InitError(message);
402  }
403  void showProgress(const std::string &title, int progress,
404  bool resume_possible) override {
405  ::uiInterface.ShowProgress(title, progress, resume_possible);
406  }
407  std::unique_ptr<Handler> handleNotifications(
408  std::shared_ptr<Notifications> notifications) override {
409  return std::make_unique<NotificationsHandlerImpl>(
410  std::move(notifications));
411  }
412  void
413  waitForNotificationsIfTipChanged(const BlockHash &old_tip) override {
414  if (!old_tip.IsNull()) {
415  LOCK(::cs_main);
416  if (old_tip == ::ChainActive().Tip()->GetBlockHash()) {
417  return;
418  }
419  }
421  }
422 
423  std::unique_ptr<Handler>
424  handleRpc(const CRPCCommand &command) override {
425  return std::make_unique<RpcHandlerImpl>(command);
426  }
427  bool rpcEnableDeprecated(const std::string &method) override {
428  return IsDeprecatedRPCEnabled(gArgs, method);
429  }
430  void rpcRunLater(const std::string &name, std::function<void()> fn,
431  int64_t seconds) override {
432  RPCRunLater(name, std::move(fn), seconds);
433  }
434  int rpcSerializationFlags() override { return RPCSerializationFlags(); }
435  void requestMempoolTransactions(Notifications &notifications) override {
436  LOCK2(::cs_main, ::g_mempool.cs);
437  for (const CTxMemPoolEntry &entry : ::g_mempool.mapTx) {
438  notifications.transactionAddedToMempool(entry.GetSharedTx());
439  }
440  }
441  const CChainParams &params() const override { return m_params; }
444  };
445 
446 } // namespace
447 
448 std::unique_ptr<Chain> MakeChain(NodeContext &node,
449  const CChainParams &params) {
450  return std::make_unique<ChainImpl>(node, params);
451 }
452 
453 } // namespace interfaces
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:338
bool ShutdownRequested()
Definition: shutdown.cpp:18
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...
bool IsDeprecatedRPCEnabled(const ArgsManager &args, const std::string &method)
Definition: server.cpp:387
bool ReadBlockFromDisk(CBlock &block, const FlatFilePos &pos, const Consensus::Params &params)
Functions for disk access for blocks.
Definition: blockdb.cpp:33
int64_t GetBlockTime() const
Definition: blockindex.h:160
Describes a place in the block chain to another node such that if the other node doesn&#39;t have the sam...
Definition: block.h:110
void GetTransactionAncestry(const TxId &txid, size_t &ancestors, size_t &descendants) const
Calculate the ancestor and descendant count for the given transaction.
Definition: txmempool.cpp:1261
Bilingual messages:
Definition: translation.h:17
Actor actor
Definition: server.h:190
static constexpr unsigned int DEFAULT_DESCENDANT_LIMIT
Default for -limitdescendantcount, max number of in-mempool descendants.
Definition: mempool.h:22
CChain & ChainActive()
Definition: validation.cpp:78
void RegisterSharedValidationInterface(std::shared_ptr< CValidationInterface > pwalletIn)
bool fHavePruned
Pruning-related variables and constants.
Definition: validation.cpp:103
NodeContext & m_node
Definition: chain.cpp:442
void InitWarning(const bilingual_str &str)
Show warning message.
BlockStatus nStatus
Verification status of this block. See enum BlockStatus.
Definition: blockindex.h:76
const CBlockIndex * LastCommonAncestor(const CBlockIndex *pa, const CBlockIndex *pb)
Find the last common ancestor two blocks have.
Definition: chain.cpp:118
static constexpr unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT
Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors.
Definition: mempool.h:20
static const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT
Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants.
Definition: mempool.h:27
bool hasData() const
Definition: blockstatus.h:54
int Height() const
Return the maximal height in the chain.
Definition: chain.h:210
Definition: amount.h:17
bool removeCommand(const std::string &name, const CRPCCommand *pcmd)
Definition: server.cpp:326
CFeeRate estimateFee() const
Definition: txmempool.cpp:938
bool isNum() const
Definition: univalue.h:94
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
Definition: chainparams.h:47
#define REVERSE_LOCK(g)
Definition: sync.h:222
void RPCRunLater(const std::string &name, std::function< void()> func, int64_t nSeconds)
Run func nSeconds from now.
Definition: server.cpp:544
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
Definition: server.cpp:316
void UnregisterSharedValidationInterface(std::shared_ptr< CValidationInterface > callbacks)
Implement this to subscribe to events generated in validation.
bool IsNull() const
Definition: uint256.h:26
CChainState & ChainstateActive()
Definition: validation.cpp:72
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
Definition: txmempool.h:65
BlockHash GetBlockHash() const
Definition: blockindex.h:133
CBlockIndex * FindEarliestAtLeast(int64_t nTime, int height) const
Find the earliest block with timestamp equal or greater than the given time and height equal or great...
Definition: chain.cpp:68
#define LOCK2(cs1, cs2)
Definition: sync.h:233
std::string name
Definition: server.h:189
CRPCTable tableRPC
Definition: server.cpp:563
Definition: config.h:19
NodeContext struct containing references to chain state and connection state.
Definition: context.h:35
CFeeRate minRelayTxFee
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) ...
Definition: validation.cpp:115
#define LOCK(cs)
Definition: sync.h:230
const char * name
Definition: rest.cpp:43
CTransactionRef GetSharedTx() const
Definition: txmempool.h:117
CTxMemPool g_mempool
Definition: validation.cpp:117
int64_t GetBlockTimeMax() const
Definition: blockindex.h:162
RecursiveMutex cs_main
Global state.
Definition: validation.cpp:95
const CRPCCommand * m_wrapped_command
Definition: chain.cpp:159
std::set< txiter, CompareIteratorById > setEntries
Definition: txmempool.h:557
bool InitError(const bilingual_str &str)
Show error message.
#define WAIT_LOCK(cs, name)
Definition: sync.h:238
std::atomic_bool fImporting
int get_int() const
bool CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntries &setAncestors, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString, bool fSearchForParents=true) const EXCLUSIVE_LOCKS_REQUIRED(cs)
Try to calculate all in-mempool ancestors of entry.
Definition: txmempool.cpp:185
Invalid wallet specified.
Definition: protocol.h:107
bool ContextualCheckTransactionForCurrentBlock(const Consensus::Params &params, const CTransaction &tx, TxValidationState &state, int flags)
This is a variant of ContextualCheckTransaction which computes the contextual check for a transaction...
int64_t GetMedianTimePast() const
Definition: blockindex.h:172
CRPCCommand m_command
Definition: chain.cpp:158
std::atomic_bool fReindex
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: blockindex.h:23
const CChainParams & Params()
Return the currently selected parameters.
int RPCSerializationFlags()
Retrieves any serialization flags requested in command line argument.
Definition: server.cpp:559
A TxId is the identifier of a transaction.
Definition: txid.h:14
double GuessVerificationProgress(const ChainTxData &data, const CBlockIndex *pindex)
Guess how far we are in the verification process at the given block index require cs_main if pindex h...
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: system.cpp:479
CBlockIndex * FindForkInGlobalIndex(const CChain &chain, const CBlockLocator &locator)
Find the last common block between the parameter chain and a locator.
Definition: validation.cpp:151
int64_t GetAdjustedTime()
Definition: timedata.cpp:34
CBlockIndex * LookupBlockIndex(const BlockHash &hash)
Definition: validation.cpp:145
std::shared_ptr< Chain::Notifications > m_notifications
Definition: chain.cpp:97
bool IsInitialBlockDownload() const
Check whether we are doing an initial block download (synchronizing from disk or network) ...
Definition: validation.cpp:901
ArgsManager gArgs
Definition: system.cpp:76
TransactionError
Definition: error.h:22
Fee rate in satoshis per kilobyte: Amount / kB.
Definition: feerate.h:21
void FindCoins(const NodeContext &node, std::map< COutPoint, Coin > &coins)
Look up unspent output information.
Definition: coin.cpp:11
CBlockLocator GetLocator(const CBlockIndex *pindex=nullptr) const
Return a CBlockLocator that refers to a block in this chain (by default the tip). ...
Definition: chain.cpp:24
static constexpr unsigned int DEFAULT_ANCESTOR_LIMIT
Default for -limitancestorcount, max number of in-mempool ancestors.
Definition: mempool.h:15
Wrapper around std::unique_lock style lock for Mutex.
Definition: sync.h:125
CClientUIInterface uiInterface
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:211
int nHeight
height of the entry in the chain. The genesis block has height 0
Definition: blockindex.h:36
const Consensus::Params & GetConsensus() const
Definition: chainparams.h:59
CBlockIndex * GetAncestor(int height)
Efficiently find an ancestor of this block.
Definition: blockindex.cpp:71
TransactionError BroadcastTransaction(NodeContext &node, const Config &config, const CTransactionRef tx, std::string &err_string, const Amount max_tx_fee, bool relay, bool wait_callback)
Submit a transaction to the mempool and (optionally) relay it to all P2P peers.
Definition: transaction.cpp:20
std::shared_ptr< NotificationsProxy > m_proxy
Definition: chain.cpp:115
CFeeRate dustRelayFee
Definition: settings.cpp:11
unsigned int nTx
Number of transactions in this block.
Definition: blockindex.h:54
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it...
Definition: txmempool.h:545
const CChainParams & m_params
Definition: chain.cpp:443
LockPoints lp
std::optional< txiter > GetIter(const TxId &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs)
Returns an iterator to the given txid, if found.
Definition: txmempool.cpp:1005
std::unique_ptr< Chain > MakeChain(NodeContext &node, const CChainParams &params)
Return implementation of Chain interface.
Definition: chain.cpp:448