Compare commits

..

4 Commits

Author SHA1 Message Date
MoneroOcean 52bb818185 Updated version 2019-01-26 08:40:49 -08:00
MoneroOcean b5ba759c9f Added new Masari support 2019-01-26 08:39:27 -08:00
MoneroOcean 35cc401a30 Fixed version 2018-09-15 16:58:14 +02:00
MoneroOcean 473f81f81b Added Loki support 2018-09-10 22:07:41 +02:00
5 changed files with 31 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cryptoforknote-util",
"version": "2.0.0",
"version": "4.0.0",
"main": "cryptoforknote-util",
"author": {
"name": "LucasJones",
+7 -5
View File
@@ -3,9 +3,11 @@
#define CURRENT_TRANSACTION_VERSION 1
enum BLOB_TYPE {
BLOB_TYPE_CRYPTONOTE = 0,
BLOB_TYPE_FORKNOTE1 = 1,
BLOB_TYPE_FORKNOTE2 = 2,
BLOB_TYPE_CRYPTONOTE2 = 3, // Masari
BLOB_TYPE_CRYPTONOTE_RYO = 4, // Ryo
BLOB_TYPE_CRYPTONOTE = 0,
BLOB_TYPE_FORKNOTE1 = 1,
BLOB_TYPE_FORKNOTE2 = 2,
BLOB_TYPE_CRYPTONOTE2 = 3, // Masari
BLOB_TYPE_CRYPTONOTE_RYO = 4, // Ryo
BLOB_TYPE_CRYPTONOTE_LOKI = 5, // Loki
BLOB_TYPE_CRYPTONOTE3 = 6, // Masari
};
+13
View File
@@ -151,8 +151,16 @@ namespace cryptonote
//extra
std::vector<uint8_t> extra;
std::vector<uint64_t> 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)
@@ -390,6 +398,7 @@ namespace cryptonote
transaction miner_tx;
std::vector<crypto::hash> tx_hashes;
mutable crypto::hash uncle = cryptonote::null_hash;
void set_blob_type(enum BLOB_TYPE bt) { miner_tx.blob_type = blob_type = bt; }
@@ -402,6 +411,10 @@ namespace cryptonote
}
FIELD(miner_tx)
FIELD(tx_hashes)
if (blob_type == BLOB_TYPE_CRYPTONOTE3)
{
FIELD(uncle)
}
END_SERIALIZE()
};
@@ -433,7 +433,9 @@ namespace cryptonote
crypto::hash tree_root_hash = get_tx_tree_hash(b);
blob.append(reinterpret_cast<const char*>(&tree_root_hash), sizeof(tree_root_hash));
blob.append(tools::get_varint_data(b.tx_hashes.size()+1));
if (b.blob_type == BLOB_TYPE_CRYPTONOTE3) {
blob.append(reinterpret_cast<const char*>(&b.uncle), sizeof(b.uncle));
}
return true;
}
//---------------------------------------------------------------
+7
View File
@@ -45,6 +45,13 @@ inline bool do_serialize(Archive &ar, T &v)
return ::serializer<Archive, T>::serialize(ar, v);
}
template <class Archive>
inline bool do_serialize(Archive &ar, bool &v)
{
ar.serialize_blob(&v, sizeof(v));
return true;
}
#ifndef __GNUC__
#ifndef constexpr
#define constexpr