mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 13:13:49 +01:00
Allow block announcements with headers
This replaces using inv messages to announce new blocks, when a peer requests (via the new "sendheaders" message) that blocks be announced with headers instead of inv's. Since headers-first was introduced, peers send getheaders messages in response to an inv, which requires generating a block locator that is large compared to the size of the header being requested, and requires an extra round-trip before a reorg can be relayed. Save time by tracking headers that a peer is likely to know about, and send a headers chain that would connect to a peer's known headers, unless the chain would be too big, in which case we revert to sending an inv instead. Based off of @sipa's commit to announce all blocks in a reorg via inv, which has been squashed into this commit. Rebased-by: Pieter Wuille
This commit is contained in:
committed by
Pieter Wuille
parent
c894fbbb1d
commit
50262d8953
@@ -9,7 +9,7 @@
|
||||
* network protocol versioning
|
||||
*/
|
||||
|
||||
static const int PROTOCOL_VERSION = 70011;
|
||||
static const int PROTOCOL_VERSION = 70012;
|
||||
|
||||
//! initial proto version, to be increased after version/verack negotiation
|
||||
static const int INIT_PROTO_VERSION = 209;
|
||||
@@ -37,4 +37,7 @@ static const int MEMPOOL_GD_VERSION = 60002;
|
||||
//! "filter*" commands are disabled without NODE_BLOOM after and including this version
|
||||
static const int NO_BLOOM_VERSION = 70011;
|
||||
|
||||
//! "sendheaders" command and announcing blocks with headers starts with this version
|
||||
static const int SENDHEADERS_VERSION = 70012;
|
||||
|
||||
#endif // BITCOIN_VERSION_H
|
||||
|
||||
Reference in New Issue
Block a user