From 473f81f81bc55a1fc4c6f5ce55d1feb9b9cf6f61 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Mon, 10 Sep 2018 22:07:41 +0200 Subject: [PATCH] Added Loki support --- src/cryptonote_config.h | 1 + src/cryptonote_core/cryptonote_basic.h | 8 ++++++++ src/serialization/serialization.h | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 6b497aae..9dccf4a9 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -8,4 +8,5 @@ enum BLOB_TYPE { BLOB_TYPE_FORKNOTE2 = 2, BLOB_TYPE_CRYPTONOTE2 = 3, // Masari BLOB_TYPE_CRYPTONOTE_RYO = 4, // Ryo + BLOB_TYPE_CRYPTONOTE_LOKI = 5, // Loki }; \ No newline at end of file diff --git a/src/cryptonote_core/cryptonote_basic.h b/src/cryptonote_core/cryptonote_basic.h index d72206bb..a7e2ac11 100644 --- a/src/cryptonote_core/cryptonote_basic.h +++ b/src/cryptonote_core/cryptonote_basic.h @@ -151,8 +151,16 @@ namespace cryptonote //extra std::vector extra; + std::vector output_unlock_times; + bool is_deregister; + BEGIN_SERIALIZE() VARINT_FIELD(version) + if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI) + { + FIELD(output_unlock_times) + FIELD(is_deregister) + } VARINT_FIELD(unlock_time) FIELD(vin) FIELD(vout) diff --git a/src/serialization/serialization.h b/src/serialization/serialization.h index 7024fdc0..6802cdcf 100644 --- a/src/serialization/serialization.h +++ b/src/serialization/serialization.h @@ -45,6 +45,13 @@ inline bool do_serialize(Archive &ar, T &v) return ::serializer::serialize(ar, v); } +template +inline bool do_serialize(Archive &ar, bool &v) +{ + ar.serialize_blob(&v, sizeof(v)); + return true; +} + #ifndef __GNUC__ #ifndef constexpr #define constexpr