Merge #11113: [net] Ignore getheaders requests for very old side blocks

eff4bd8 [test] P2P functional test for certain fingerprinting protections (Jim Posen)
a2be3b6 [net] Ignore getheaders requests for very old side blocks (Jim Posen)

Pull request description:

  Sending a getheaders message with an empty locator and a stop hash is a request for a single header by hash. The node will respond with headers for blocks not in the main chain as well as those in the main chain. To avoid fingerprinting, the node should, however, ignore requests for headers on side branches that are too old. This replicates the logic that currently exists for `getdata` requests for blocks.

Tree-SHA512: e04ef61e2b73945be6ec5977b3c5680b6dc3667246f8bfb67afae1ecaba900c0b49b18bbbb74869f7a37ef70b6ed99e78ebe0ea0a1569369fad9e447d720ffc4
This commit is contained in:
Wladimir J. van der Laan committed 2017-10-11 10:54:05 +02:00
commit fef65c4f5e
4 files changed
+189 -11

No files matched your search

+2 -2
View File
@@ -1310,8 +1310,8 @@ class msg_getheaders(object):
class msg_headers(object):
command = b"headers"
def __init__(self):
self.headers = []
def __init__(self, headers=None):
self.headers = headers if headers is not None else []
def deserialize(self, f):
# comment in bitcoind indicates these should be deserialized as blocks