Skip to content

Commit fab53ff

Browse files
author
MarcoFalke
committed
Remove unused SERIALIZE_METHODS for CBanEntry
1 parent 7be143a commit fab53ff

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

src/addrdb.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88

99
#include <fs.h>
1010
#include <net_types.h> // For banmap_t
11-
#include <serialize.h>
1211
#include <univalue.h>
1312

14-
#include <string>
1513
#include <vector>
1614

1715
class CAddress;
@@ -44,12 +42,6 @@ class CBanEntry
4442
*/
4543
explicit CBanEntry(const UniValue& json);
4644

47-
SERIALIZE_METHODS(CBanEntry, obj)
48-
{
49-
uint8_t ban_reason = 2; //! For backward compatibility
50-
READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, ban_reason);
51-
}
52-
5345
void SetNull()
5446
{
5547
nVersion = CBanEntry::CURRENT_VERSION;

src/test/fuzz/addrdb.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@ FUZZ_TARGET(addrdb)
1818
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
1919

2020
// The point of this code is to exercise all CBanEntry constructors.
21-
const CBanEntry ban_entry = [&] {
22-
switch (fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 2)) {
23-
case 0:
24-
return CBanEntry{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
25-
break;
26-
case 1: {
27-
const std::optional<CBanEntry> ban_entry = ConsumeDeserializable<CBanEntry>(fuzzed_data_provider);
28-
if (ban_entry) {
29-
return *ban_entry;
30-
}
31-
break;
32-
}
33-
}
34-
return CBanEntry{};
35-
}();
21+
const CBanEntry ban_entry{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
3622
(void)ban_entry; // currently unused
3723
}

src/test/fuzz/deserialize.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ FUZZ_TARGET_DESERIALIZE(blockheader_deserialize, {
195195
CBlockHeader bh;
196196
DeserializeFromFuzzingInput(buffer, bh);
197197
})
198-
FUZZ_TARGET_DESERIALIZE(banentry_deserialize, {
199-
CBanEntry be;
200-
DeserializeFromFuzzingInput(buffer, be);
201-
})
202198
FUZZ_TARGET_DESERIALIZE(txundo_deserialize, {
203199
CTxUndo tu;
204200
DeserializeFromFuzzingInput(buffer, tu);

0 commit comments

Comments
 (0)