aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_defs.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-09 09:31:00 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-09 10:28:41 +0100
commit635929eaca6b376708d7c5fabf9b743b8a706981 (patch)
treea5989505a602cd2fe0ef3a425292f9213adfd1fb /src/cryptonote_protocol/cryptonote_protocol_defs.h
parentepee: fixup KV_SERIALIZE_OPT to work in more cases (diff)
downloadmonero-635929eaca6b376708d7c5fabf9b743b8a706981.tar.xz
protocol: add checks for top block hard fork version
We won't even talk to a peer which claims a wrong version for its top block. This will avoid syncing to known bad peers in the first place. Also add IP fails when failing to verify a block.
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_defs.h')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_defs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_defs.h b/src/cryptonote_protocol/cryptonote_protocol_defs.h
index 042ae49f6..37b503436 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_defs.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_defs.h
@@ -195,10 +195,12 @@ namespace cryptonote
{
uint64_t current_height;
crypto::hash top_id;
+ uint8_t top_version;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(current_height)
KV_SERIALIZE_VAL_POD_AS_BLOB(top_id)
+ KV_SERIALIZE_OPT(top_version, (uint8_t)0)
END_KV_SERIALIZE_MAP()
};