mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
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 commitdbcb5742c4
and commite08770bed1
, 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.
This commit is contained in:
parent
8779adbdda
commit
fa243e9313
2 changed files with 2 additions and 7 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <streams.h>
|
||||
#include <util/system.h>
|
||||
#include <util/translation.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdio>
|
||||
|
|
|
@ -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 <serialize.h>
|
||||
#include <streams.h>
|
||||
#include <uint256.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
/** 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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue