working premine; empty first version of PROTOCOL_TX in block

This commit is contained in:
Some Random Crypto Guy
2023-10-18 10:48:16 +01:00
parent d186cf95c1
commit 0b3633ccdc
667 changed files with 8288 additions and 5019 deletions
+11 -5
View File
@@ -1,4 +1,5 @@
// Copyright (c) 2014-2023, The Monero Project
// Copyright (c) 2019-2023, Haven Protocol
// Portions copyright (c) 2014-2022, The Monero Project
//
// All rights reserved.
//
@@ -31,6 +32,7 @@
#pragma once
#include <memory>
#include "serialization.h"
#include "json_archive.h"
template <template <bool> class Archive>
inline bool do_serialize(Archive<false>& ar, std::string& str)
@@ -50,12 +52,16 @@ inline bool do_serialize(Archive<false>& ar, std::string& str)
return true;
}
template <template <bool> class Archive>
inline bool do_serialize(Archive<true>& ar, std::string& str)
{
size_t size = str.size();
ar.serialize_varint(size);
ar.serialize_blob(const_cast<std::string::value_type*>(str.c_str()), size);
if (typeid(ar) == typeid(json_archive<true>)) {
size_t size = str.size();
ar.serialize_readable_string(const_cast<std::string::value_type*>(str.c_str()), size);
} else {
size_t size = str.size();
ar.serialize_varint(size);
ar.serialize_blob(const_cast<std::string::value_type*>(str.c_str()), size);
}
return true;
}