diff --git a/package.json b/package.json index a7516c4..277e474 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cryptoforknote-util", - "version": "6.0.0", + "version": "7.0.2", "main": "cryptoforknote-util", "author": { "name": "LucasJones", diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 0b241f7..21f9d46 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -12,4 +12,5 @@ enum BLOB_TYPE { BLOB_TYPE_CRYPTONOTE3 = 6, // Masari BLOB_TYPE_AEON = 7, // Aeon BLOB_TYPE_CRYPTONOTE_CUCKOO = 8, // MoneroV / Swap + BLOB_TYPE_CRYPTONOTE_XTNC = 9, // XTNC }; diff --git a/src/cryptonote_core/cryptonote_basic.h b/src/cryptonote_core/cryptonote_basic.h index d8ff450..acd5477 100644 --- a/src/cryptonote_core/cryptonote_basic.h +++ b/src/cryptonote_core/cryptonote_basic.h @@ -184,7 +184,7 @@ namespace cryptonote BEGIN_SERIALIZE() VARINT_FIELD(version) - if (version > loki_version_2 && blob_type == BLOB_TYPE_CRYPTONOTE_LOKI) + if (version > loki_version_2 && (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC)) { FIELD(output_unlock_times) if (version == loki_version_3_per_output_unlock_times) @@ -193,12 +193,12 @@ namespace cryptonote VARINT_FIELD(unlock_time) FIELD(vin) FIELD(vout) - if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI) + if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC) { if (version >= loki_version_3_per_output_unlock_times && vout.size() != output_unlock_times.size()) return false; } FIELD(extra) - if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI && version >= loki_version_4_tx_types) + if ((blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC) && version >= loki_version_4_tx_types) { VARINT_FIELD(type) if (static_cast(type) >= loki_type_count) return false; @@ -449,7 +449,7 @@ namespace cryptonote if (!typename Archive::is_saving()) nonce = nonce32; } } - if (blob_type == BLOB_TYPE_CRYPTONOTE_CUCKOO) FIELD(cycle) + if (blob_type == BLOB_TYPE_CRYPTONOTE_XTNC || blob_type == BLOB_TYPE_CRYPTONOTE_CUCKOO) FIELD(cycle) END_SERIALIZE() }; diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 3f650ab..3ee7090 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -429,7 +429,7 @@ namespace cryptonote //--------------------------------------------------------------- bool get_block_hashing_blob(const block& b, blobdata& blob) { - if (b.blob_type == BLOB_TYPE_CRYPTONOTE_CUCKOO) { + if (b.blob_type == BLOB_TYPE_CRYPTONOTE_XTNC || b.blob_type == BLOB_TYPE_CRYPTONOTE_CUCKOO) { blob = t_serializable_object_to_blob(b.major_version); blob.append(reinterpret_cast(&b.minor_version), sizeof(b.minor_version)); blob.append(reinterpret_cast(&b.timestamp), sizeof(b.timestamp)); diff --git a/src/main.cc b/src/main.cc index 3a53a7d..b430e95 100644 --- a/src/main.cc +++ b/src/main.cc @@ -216,7 +216,7 @@ NAN_METHOD(construct_block_blob) { // (parentBlockTemplateBuffer, nonceBuffer, c if (!mergeBlocks(parent_block, b, std::vector())) return THROW_ERROR_EXCEPTION("Failed to postprocess mining block"); } - if (blob_type == BLOB_TYPE_CRYPTONOTE_CUCKOO) { + if (blob_type == BLOB_TYPE_CRYPTONOTE_XTNC || blob_type == BLOB_TYPE_CRYPTONOTE_CUCKOO) { if (info.Length() != 4) return THROW_ERROR_EXCEPTION("You must provide 4 arguments."); Local cycle = Local::Cast(info[3]); for (int i = 0; i < 32; i++ ) b.cycle.data[i] = cycle->Get(i)->NumberValue(); @@ -311,7 +311,7 @@ NAN_METHOD(construct_mm_parent_block_blob) { // (parentBlockTemplate, blob_type, block b = AUTO_VAL_INIT(b); b.set_blob_type(blob_type); if (!parse_and_validate_block_from_blob(input, b)) return THROW_ERROR_EXCEPTION("construct_mm_parent_block_blob: Failed to parse prent block"); - if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI) b.miner_tx.version = cryptonote::loki_version_2; + if (blob_type == BLOB_TYPE_CRYPTONOTE_LOKI || blob_type == BLOB_TYPE_CRYPTONOTE_XTNC) b.miner_tx.version = cryptonote::loki_version_2; block b2 = AUTO_VAL_INIT(b2); b2.set_blob_type(BLOB_TYPE_FORKNOTE2);