Added new Masari support

This commit is contained in:
MoneroOcean
2019-01-26 08:39:27 -08:00
parent 35cc401a30
commit b5ba759c9f
3 changed files with 14 additions and 6 deletions

View File

@@ -9,4 +9,5 @@ enum BLOB_TYPE {
BLOB_TYPE_CRYPTONOTE2 = 3, // Masari BLOB_TYPE_CRYPTONOTE2 = 3, // Masari
BLOB_TYPE_CRYPTONOTE_RYO = 4, // Ryo BLOB_TYPE_CRYPTONOTE_RYO = 4, // Ryo
BLOB_TYPE_CRYPTONOTE_LOKI = 5, // Loki BLOB_TYPE_CRYPTONOTE_LOKI = 5, // Loki
BLOB_TYPE_CRYPTONOTE3 = 6, // Masari
}; };

View File

@@ -398,6 +398,7 @@ namespace cryptonote
transaction miner_tx; transaction miner_tx;
std::vector<crypto::hash> tx_hashes; 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; } void set_blob_type(enum BLOB_TYPE bt) { miner_tx.blob_type = blob_type = bt; }
@@ -410,6 +411,10 @@ namespace cryptonote
} }
FIELD(miner_tx) FIELD(miner_tx)
FIELD(tx_hashes) FIELD(tx_hashes)
if (blob_type == BLOB_TYPE_CRYPTONOTE3)
{
FIELD(uncle)
}
END_SERIALIZE() END_SERIALIZE()
}; };

View File

@@ -433,7 +433,9 @@ namespace cryptonote
crypto::hash tree_root_hash = get_tx_tree_hash(b); 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(reinterpret_cast<const char*>(&tree_root_hash), sizeof(tree_root_hash));
blob.append(tools::get_varint_data(b.tx_hashes.size()+1)); 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; return true;
} }
//--------------------------------------------------------------- //---------------------------------------------------------------