From fa243e93138d899f41be02af3fa2b029dd8d525e Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 7 Apr 2022 14:34:01 +0200 Subject: Remove no-op TIME_INIT on deser Assigning TIME_INIT to nTime was needed to fully re-initialize a dirty object where the deserialization might skip nTime. See https://github.com/bitcoin/bitcoin/pull/19020/files#r427620111 Now that the without-nTime logic is removed in commit dbcb5742c48fd26f77e500291d7083e12eec741b and commit e08770bed187bfa66f525d42e484579bcea78bba, the logic here can be removed as well. Also, remove confusing and redundant preprocessor code. Also, remove no longer needed version.h include, which was needed for INIT_PROTO_VERSION. --- src/protocol.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index fdeaa9a9c5..da2d24aff3 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -3,10 +3,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef __cplusplus -#error This header can only be compiled as C++. -#endif - #ifndef BITCOIN_PROTOCOL_H #define BITCOIN_PROTOCOL_H @@ -15,10 +11,9 @@ #include #include #include -#include +#include #include -#include #include /** Message header. @@ -420,7 +415,6 @@ public: use_v2 = s.GetVersion() & ADDRV2_FORMAT; } - SER_READ(obj, obj.nTime = TIME_INIT); READWRITE(obj.nTime); // nServices is serialized as CompactSize in V2; as uint64_t in V1. if (use_v2) { -- cgit v1.2.3