aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_peerlist_boost_serialization.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/p2p/net_peerlist_boost_serialization.h')
-rw-r--r--src/p2p/net_peerlist_boost_serialization.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/p2p/net_peerlist_boost_serialization.h b/src/p2p/net_peerlist_boost_serialization.h
index e79207888..2f4a7e661 100644
--- a/src/p2p/net_peerlist_boost_serialization.h
+++ b/src/p2p/net_peerlist_boost_serialization.h
@@ -33,6 +33,10 @@
#include "net/net_utils_base.h"
#include "p2p/p2p_protocol_defs.h"
+#ifdef CRYPTONOTE_PRUNING_DEBUG_SPOOF_SEED
+#include "common/pruning.h"
+#endif
+
namespace boost
{
namespace serialization
@@ -77,6 +81,19 @@ namespace boost
a & pl.adr;
a & pl.id;
a & pl.last_seen;
+ if (ver < 1)
+ {
+ if (!typename Archive::is_saving())
+ pl.pruning_seed = 0;
+ return;
+ }
+ a & pl.pruning_seed;
+#ifdef CRYPTONOTE_PRUNING_DEBUG_SPOOF_SEED
+ if (!typename Archive::is_saving())
+ {
+ pl.pruning_seed = tools::make_pruning_seed(1+pl.adr.as<epee::net_utils::ipv4_network_address>().ip() % (1<<CRYPTONOTE_PRUNING_LOG_STRIPES), CRYPTONOTE_PRUNING_LOG_STRIPES);
+ }
+#endif
}
template <class Archive, class ver_type>