aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-06-29 09:41:53 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-29 09:45:56 -0400
commit8edfc1715a02cbaf52420d3c4e71f67ff9af0b41 (patch)
tree6250eab4d276db39cfeac975fdb4718f34615598 /src/validation.h
parent748178f13e5b8a13ea2b2eb7b634fead960100f1 (diff)
parentfa525e4d1cfda8c1924d2c69f43bd7ae3b98fb72 (diff)
downloadbitcoin-8edfc1715a02cbaf52420d3c4e71f67ff9af0b41.tar.xz
Merge #19204: p2p: Reduce inv traffic during IBD
fa525e4d1cfda8c1924d2c69f43bd7ae3b98fb72 net: Avoid wasting inv traffic during IBD (MarcoFalke) fa06d7e93489e61078cfb95ab767c001536a6e10 refactor: block import implies IsInitialBlockDownload (MarcoFalke) faba65e696a88e5626e587f4e63fa15500cbe4d0 Add ChainstateManager::ActiveChainstate (MarcoFalke) fabf3d64ff2bd14f762810316144bb9fd69c517c test: Add FeeFilterRounder test (MarcoFalke) Pull request description: Tx-inv messages are ignored during IBD, so it would be nice if we told peers to not send them in the first place. Do that by sending two `feefilter` messages: One when the connection is made (and the node is in IBD), and another one when the node leaves IBD. ACKs for top commit: jamesob: ACK fa525e4d1cfda8c1924d2c69f43bd7ae3b98fb72 ([`jamesob/ackr/19204.1.MarcoFalke.p2p_reduce_inv_traffic_d`](https://github.com/jamesob/bitcoin/tree/ackr/19204.1.MarcoFalke.p2p_reduce_inv_traffic_d)) naumenkogs: utACK fa525e4 gzhao408: ACK https://github.com/bitcoin/bitcoin/commit/fa525e4d1cfda8c1924d2c69f43bd7ae3b98fb72 jonatack: re-ACK fa525e4 checked diff `git range-diff 19612ca fa8a66c fa525e4`, re-reviewed, ran tests, ran a custom p2p IBD behavior test at https://github.com/jonatack/bitcoin/commit/9321e0f223ea87d21f6fa42b61bcc8d40a0943de. hebasto: re-ACK fa525e4d1cfda8c1924d2c69f43bd7ae3b98fb72, only rebased since the [previous](https://github.com/bitcoin/bitcoin/pull/19204#pullrequestreview-429519667) review (verified with `git range-diff`). Tree-SHA512: 2c22a5def9822396fca45d808b165b636f1143c4bdb2eaa5c7e977f1f18e8b10c86d4c180da488def38416cf3076a26de15014dfd4d86b2a7e5af88c74afb8eb
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/validation.h b/src/validation.h
index e403bcb51a..58383ad923 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -799,7 +799,8 @@ public:
std::vector<CChainState*> GetAll();
//! The most-work chain.
- CChain& ActiveChain() const;
+ CChainState& ActiveChainstate() const;
+ CChain& ActiveChain() const { return ActiveChainstate().m_chain; }
int ActiveHeight() const { return ActiveChain().Height(); }
CBlockIndex* ActiveTip() const { return ActiveChain().Tip(); }
@@ -879,13 +880,13 @@ public:
/** DEPRECATED! Please use node.chainman instead. May only be used in validation.cpp internally */
extern ChainstateManager g_chainman GUARDED_BY(::cs_main);
-/** @returns the most-work valid chainstate. */
+/** Please prefer the identical ChainstateManager::ActiveChainstate */
CChainState& ChainstateActive();
-/** @returns the most-work chain. */
+/** Please prefer the identical ChainstateManager::ActiveChain */
CChain& ChainActive();
-/** @returns the global block index map. */
+/** Please prefer the identical ChainstateManager::BlockIndex */
BlockMap& BlockIndex();
/** Global variable that points to the active block tree (protected by cs_main) */