mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 13:32:33 +02:00
Remove unused SERIALIZE_METHODS for CBanEntry
This commit is contained in:
parent
7be143a960
commit
fab53ff1e5
@ -8,10 +8,8 @@
|
|||||||
|
|
||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
#include <net_types.h> // For banmap_t
|
#include <net_types.h> // For banmap_t
|
||||||
#include <serialize.h>
|
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class CAddress;
|
class CAddress;
|
||||||
@ -44,12 +42,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
explicit CBanEntry(const UniValue& json);
|
explicit CBanEntry(const UniValue& json);
|
||||||
|
|
||||||
SERIALIZE_METHODS(CBanEntry, obj)
|
|
||||||
{
|
|
||||||
uint8_t ban_reason = 2; //! For backward compatibility
|
|
||||||
READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, ban_reason);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetNull()
|
void SetNull()
|
||||||
{
|
{
|
||||||
nVersion = CBanEntry::CURRENT_VERSION;
|
nVersion = CBanEntry::CURRENT_VERSION;
|
||||||
|
@ -18,20 +18,6 @@ FUZZ_TARGET(addrdb)
|
|||||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||||
|
|
||||||
// The point of this code is to exercise all CBanEntry constructors.
|
// The point of this code is to exercise all CBanEntry constructors.
|
||||||
const CBanEntry ban_entry = [&] {
|
const CBanEntry ban_entry{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
|
||||||
switch (fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 2)) {
|
|
||||||
case 0:
|
|
||||||
return CBanEntry{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
|
|
||||||
break;
|
|
||||||
case 1: {
|
|
||||||
const std::optional<CBanEntry> ban_entry = ConsumeDeserializable<CBanEntry>(fuzzed_data_provider);
|
|
||||||
if (ban_entry) {
|
|
||||||
return *ban_entry;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return CBanEntry{};
|
|
||||||
}();
|
|
||||||
(void)ban_entry; // currently unused
|
(void)ban_entry; // currently unused
|
||||||
}
|
}
|
||||||
|
@ -195,10 +195,6 @@ FUZZ_TARGET_DESERIALIZE(blockheader_deserialize, {
|
|||||||
CBlockHeader bh;
|
CBlockHeader bh;
|
||||||
DeserializeFromFuzzingInput(buffer, bh);
|
DeserializeFromFuzzingInput(buffer, bh);
|
||||||
})
|
})
|
||||||
FUZZ_TARGET_DESERIALIZE(banentry_deserialize, {
|
|
||||||
CBanEntry be;
|
|
||||||
DeserializeFromFuzzingInput(buffer, be);
|
|
||||||
})
|
|
||||||
FUZZ_TARGET_DESERIALIZE(txundo_deserialize, {
|
FUZZ_TARGET_DESERIALIZE(txundo_deserialize, {
|
||||||
CTxUndo tu;
|
CTxUndo tu;
|
||||||
DeserializeFromFuzzingInput(buffer, tu);
|
DeserializeFromFuzzingInput(buffer, tu);
|
||||||
|
Loading…
Reference in New Issue
Block a user