Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/nbproject/
1 change: 1 addition & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"include_dirs": [
"src",
"src/contrib/epee/include",
"<!(node -e \"require('nan')\")",
],
"link_settings": {
"libraries": [
Expand Down
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"name": "cryptonote-util",
"version": "0.0.1",
"main": "cryptonote",
"author": {
"name": "LucasJones",
"email": "lucasjonesdev@hotmail.co.uk"
},
"repository": {
"type": "git",
"url": "https://github.com/LucasJones/node-cryptonote-util.git"
},
"dependencies" : {
"bindings" : "*"
},
"keywords": [
"cryptonight",
"cryptonote"
]
"name": "cryptonote-util",
"version": "0.0.1",
"main": "cryptonote",
"author": {
"name": "LucasJones",
"email": "lucasjonesdev@hotmail.co.uk"
},
"repository": {
"type": "git",
"url": "https://github.com/clintar/node-cryptonote-util.git"
},
"dependencies": {
"bindings": "*",
"nan": "^2.0.0"
},
"keywords": [
"cryptonight",
"cryptonote"
]
}
4 changes: 2 additions & 2 deletions src/crypto/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ DISABLE_VS_WARNINGS(4200)
struct {
ec_point a, b;
} ab[];
};
}rcs;
POP_WARNINGS

static inline size_t rs_comm_size(size_t pubs_count) {
return sizeof(rs_comm) + pubs_count * sizeof(rs_comm().ab[0]);
return sizeof(rs_comm) + pubs_count * sizeof(rcs.ab[0]);
}

void crypto_ops::generate_ring_signature(const hash &prefix_hash, const key_image &image,
Expand Down
20 changes: 7 additions & 13 deletions src/cryptonote_core/cryptonote_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,9 @@ namespace cryptonote
VARINT_FIELD(major_version)
if(major_version > BLOCK_MAJOR_VERSION_2) return false;
VARINT_FIELD(minor_version)
if (BLOCK_MAJOR_VERSION_1 == major_version)
{
VARINT_FIELD(timestamp)
}
VARINT_FIELD(timestamp)
FIELD(prev_id)
if (BLOCK_MAJOR_VERSION_1 == major_version)
{
FIELD(nonce)
}
FIELD(nonce)
END_SERIALIZE()
};

Expand All @@ -479,11 +473,11 @@ namespace cryptonote

BEGIN_SERIALIZE_OBJECT()
FIELDS(*static_cast<block_header *>(this))
if (BLOCK_MAJOR_VERSION_2 <= major_version)
{
auto sbb = make_serializable_bytecoin_block(*this, false, false);
FIELD_N("parent_block", sbb);
}
// if (BLOCK_MAJOR_VERSION_2 <= major_version)
// {
// auto sbb = make_serializable_bytecoin_block(*this, false, false);
// FIELD_N("parent_block", sbb);
// }
FIELD(miner_tx)
FIELD(tx_hashes)
END_SERIALIZE()
Expand Down
22 changes: 11 additions & 11 deletions src/cryptonote_core/cryptonote_format_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,15 @@ namespace cryptonote
if (!get_block_hashing_blob(b, blob))
return false;

if (BLOCK_MAJOR_VERSION_2 <= b.major_version)
{
blobdata parent_blob;
auto sbb = make_serializable_bytecoin_block(b, true, false);
if (!t_serializable_object_to_blob(sbb, parent_blob))
return false;
// if (BLOCK_MAJOR_VERSION_2 <= b.major_version)
// {
// blobdata parent_blob;
// auto sbb = make_serializable_bytecoin_block(b, true, false);
// if (!t_serializable_object_to_blob(sbb, parent_blob))
// return false;

blob.append(parent_blob);
}
// blob.append(parent_blob);
// }

return get_object_hash(blob, res);
}
Expand Down Expand Up @@ -851,8 +851,8 @@ namespace cryptonote
//---------------------------------------------------------------
bool check_proof_of_work_v1(const block& bl, difficulty_type current_diffic, crypto::hash& proof_of_work)
{
if (BLOCK_MAJOR_VERSION_1 != bl.major_version)
return false;
// if (BLOCK_MAJOR_VERSION_1 != bl.major_version)
// return false;

proof_of_work = get_block_longhash(bl, 0);
return check_hash(proof_of_work, current_diffic);
Expand Down Expand Up @@ -899,7 +899,7 @@ namespace cryptonote
switch (bl.major_version)
{
case BLOCK_MAJOR_VERSION_1: return check_proof_of_work_v1(bl, current_diffic, proof_of_work);
case BLOCK_MAJOR_VERSION_2: return check_proof_of_work_v2(bl, current_diffic, proof_of_work);
case BLOCK_MAJOR_VERSION_2: return check_proof_of_work_v1(bl, current_diffic, proof_of_work);
}

CHECK_AND_ASSERT_MES(false, false, "unknown block major version: " << bl.major_version << "." << bl.minor_version);
Expand Down
Loading