mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-17 21:32:00 +01:00
Merge cce0c5b41689a88d15f4631418151e099fd20ebe into 5f4422d68dc3530c353af1f87499de1c864b60ad
This commit is contained in:
commit
b6c24ae597
@ -711,7 +711,7 @@ public:
|
|||||||
" \"b\" - BLOOM: peer can handle bloom-filtered connections (see BIP 111)\n"
|
" \"b\" - BLOOM: peer can handle bloom-filtered connections (see BIP 111)\n"
|
||||||
" \"w\" - WITNESS: peer can be asked for blocks and transactions with witness data (SegWit)\n"
|
" \"w\" - WITNESS: peer can be asked for blocks and transactions with witness data (SegWit)\n"
|
||||||
" \"c\" - COMPACT_FILTERS: peer can handle basic block filter requests (see BIPs 157 and 158)\n"
|
" \"c\" - COMPACT_FILTERS: peer can handle basic block filter requests (see BIPs 157 and 158)\n"
|
||||||
" \"l\" - NETWORK_LIMITED: peer limited to serving only the last 288 blocks (~2 days)\n"
|
" \"l\" - NETWORK_LIMITED: peer can serve at least the last 288 blocks (~2 days); see BIP 159\n"
|
||||||
" \"2\" - P2P_V2: peer supports version 2 P2P transport protocol, as defined in BIP 324\n"
|
" \"2\" - P2P_V2: peer supports version 2 P2P transport protocol, as defined in BIP 324\n"
|
||||||
" \"u\" - UNKNOWN: unrecognized bit flag\n"
|
" \"u\" - UNKNOWN: unrecognized bit flag\n"
|
||||||
" v Version of transport protocol used for the connection\n"
|
" v Version of transport protocol used for the connection\n"
|
||||||
|
@ -1102,8 +1102,8 @@ static bool CanServeBlocks(const Peer& peer)
|
|||||||
return peer.m_their_services & (NODE_NETWORK|NODE_NETWORK_LIMITED);
|
return peer.m_their_services & (NODE_NETWORK|NODE_NETWORK_LIMITED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Whether this peer can only serve limited recent blocks (e.g. because
|
/** Whether this is a BIP159 peer that can only serve limited recent blocks
|
||||||
* it prunes old blocks) */
|
* (e.g. because it prunes old blocks) */
|
||||||
static bool IsLimitedPeer(const Peer& peer)
|
static bool IsLimitedPeer(const Peer& peer)
|
||||||
{
|
{
|
||||||
return (!(peer.m_their_services & NODE_NETWORK) &&
|
return (!(peer.m_their_services & NODE_NETWORK) &&
|
||||||
@ -1476,7 +1476,7 @@ void PeerManagerImpl::FindNextBlocks(std::vector<const CBlockIndex*>& vBlocks, c
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't request blocks that go further than what limited peers can provide
|
// Don't request blocks beyond the minimum number that BIP159 limited peers must be able to provide.
|
||||||
if (is_limited_peer && (state->pindexBestKnownBlock->nHeight - pindex->nHeight >= static_cast<int>(NODE_NETWORK_LIMITED_MIN_BLOCKS) - 2 /* two blocks buffer for possible races */)) {
|
if (is_limited_peer && (state->pindexBestKnownBlock->nHeight - pindex->nHeight >= static_cast<int>(NODE_NETWORK_LIMITED_MIN_BLOCKS) - 2 /* two blocks buffer for possible races */)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -321,9 +321,8 @@ enum ServiceFlags : uint64_t {
|
|||||||
// NODE_COMPACT_FILTERS means the node will service basic block filter requests.
|
// NODE_COMPACT_FILTERS means the node will service basic block filter requests.
|
||||||
// See BIP157 and BIP158 for details on how this is implemented.
|
// See BIP157 and BIP158 for details on how this is implemented.
|
||||||
NODE_COMPACT_FILTERS = (1 << 6),
|
NODE_COMPACT_FILTERS = (1 << 6),
|
||||||
// NODE_NETWORK_LIMITED means the same as NODE_NETWORK with the limitation of only
|
// NODE_NETWORK_LIMITED indicates that the node can serve at least the last
|
||||||
// serving the last 288 (2 day) blocks
|
// 288 blocks (~2 days). See BIP159 for details on how this is implemented.
|
||||||
// See BIP159 for details on how this is implemented.
|
|
||||||
NODE_NETWORK_LIMITED = (1 << 10),
|
NODE_NETWORK_LIMITED = (1 << 10),
|
||||||
|
|
||||||
// NODE_P2P_V2 means the node supports BIP324 transport
|
// NODE_P2P_V2 means the node supports BIP324 transport
|
||||||
|
Loading…
x
Reference in New Issue
Block a user