aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/messages.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-10-09 11:26:44 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-10-09 11:51:58 +0200
commitc08bf2b574636023cd9d68cb43b3dada5b0cc737 (patch)
treef262d6ebc83588e35ef82c5cefccca7590257853 /test/functional/test_framework/messages.py
parent1d9ac7fded554b1baf828d10f9ae7062fbf9c9eb (diff)
parentfa25f43ac5692082dba3f90456c501eb08f1b75c (diff)
downloadbitcoin-c08bf2b574636023cd9d68cb43b3dada5b0cc737.tar.xz
Merge #15437: p2p: Remove BIP61 reject messages
fa25f43ac5692082dba3f90456c501eb08f1b75c p2p: Remove BIP61 reject messages (MarcoFalke) Pull request description: Reject messages (BIP 61) appear in the following settings: * Parsing of reject messages (in case `-debug=net` is set, off by default). This has only been used for a single `LogPrint` call for several releases now. Such logging is completely meaningless to us and should thus be removed. * The sending of reject messages (in case `-enablebip61` is set, off by default). This can be used to debug a node that is under our control. Instead of hacking this debugging into the p2p protocol, it could be more easily achieved by parsing the debug log. (Use `-printtoconsole` to have it as stream, or read from the `debug.log` file like our python function `assert_debug_log` in the test framework does) Having to maintain all of this logic and code to accommodate debugging, which can be achieved by other means a lot easier, is a burden. It makes review on net processing changes a lot harder, since the reject message logic has to be carried around without introducing any errors or DOS vectors. ACKs for top commit: jnewbery: utACK fa25f43ac5692082dba3f90456c501eb08f1b75c laanwj: I'm still not 100% convinced that I like getting rid of BIP61 conceptually, but apparently everyone wants it, code review ACK fa25f43ac5692082dba3f90456c501eb08f1b75c. ryanofsky: Code review ACK fa25f43ac5692082dba3f90456c501eb08f1b75c Tree-SHA512: daf55254202925e56be3d6cfb3c1c804e7a82cecb1dd1e5bd7b472bae989fd68ac4f21ec53fc46751353056fd645f7f877bebcb0b40920257991423a3d99e0be
Diffstat (limited to 'test/functional/test_framework/messages.py')
-rwxr-xr-xtest/functional/test_framework/messages.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index 3cb5f56bee..25520a2151 100755
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -1317,38 +1317,6 @@ class msg_headers:
return "msg_headers(headers=%s)" % repr(self.headers)
-class msg_reject:
- __slots__ = ("code", "data", "message", "reason")
- command = b"reject"
- REJECT_MALFORMED = 1
-
- def __init__(self):
- self.message = b""
- self.code = 0
- self.reason = b""
- self.data = 0
-
- def deserialize(self, f):
- self.message = deser_string(f)
- self.code = struct.unpack("<B", f.read(1))[0]
- self.reason = deser_string(f)
- if (self.code != self.REJECT_MALFORMED and
- (self.message == b"block" or self.message == b"tx")):
- self.data = deser_uint256(f)
-
- def serialize(self):
- r = ser_string(self.message)
- r += struct.pack("<B", self.code)
- r += ser_string(self.reason)
- if (self.code != self.REJECT_MALFORMED and
- (self.message == b"block" or self.message == b"tx")):
- r += ser_uint256(self.data)
- return r
-
- def __repr__(self):
- return "msg_reject: %s %d %s [%064x]" \
- % (self.message, self.code, self.reason, self.data)
-
class msg_feefilter:
__slots__ = ("feerate",)