Skip to content

Commit

Permalink
Merge pull request #235 from sumoprojects/dev
Browse files Browse the repository at this point in the history
[ALL] Merge dev to master (22 July, 2019)
  • Loading branch information
sumoprojects authored Jul 22, 2019
2 parents c5a631f + bbc7751 commit 7b3bf97
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 11 deletions.
Binary file modified src/blocks/checkpoints.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion src/checkpoints/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ namespace cryptonote
ADD_CHECKPOINT(199800, "d8c7fcfcf605e834b3125b68cc96736e1f1d2f753c79c24db8fb9d6af4b84293"); // v6 fork
ADD_CHECKPOINT(274000, "49d2579161c277b9d9fe6baba5aabcef1534e9abef93eaa7f17cc8fe229454b0"); // v7 fork
ADD_CHECKPOINT(274360, "66c129116187f36980a97333f1c7cf99c21629cc52bc6d591126d3a8fe36b90a"); // v8 fork
ADD_CHECKPOINT(294360, "81b86ce75b91efcb329376eda835531fb05657d2f184a2ed9e899dba54f0515e");
ADD_CHECKPOINT(300000, "b09b147b23148d2995ff860d9ede9d8d38757c934b6de7945d397fc4e1ab2501");

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ bool Blockchain::deinit()
// It starts a batch and calls private method pop_block_from_blockchain().
void Blockchain::pop_blocks(uint64_t nblocks)
{
uint64_t i;
uint64_t i(0);
CRITICAL_REGION_LOCAL(m_tx_pool);
CRITICAL_REGION_LOCAL1(m_blockchain_lock);

Expand Down Expand Up @@ -4901,7 +4901,7 @@ void Blockchain::cancel()
}

#if defined(PER_BLOCK_CHECKPOINT)
static const char expected_block_hashes_hash[] = "8bd6c4fff119d791d1be231a3743fa3978368cabdcd513fccfad4656e8ce2c57";
static const char expected_block_hashes_hash[] = "d890ae0285728cc2c95a39fdf27d2c3c96aa86a1a9e841ad7d2f2a5a54df9033";
void Blockchain::load_compiled_in_block_hashes(const GetCheckpointsCallback& get_checkpoints)
{
if (get_checkpoints == nullptr || !m_fast_sync)
Expand Down
6 changes: 4 additions & 2 deletions src/cryptonote_core/tx_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ namespace cryptonote
//baseline empty block
get_block_reward(median_weight, total_weight, already_generated_coins, best_coinbase, height);

size_t max_total_weight = 2 * median_weight - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
size_t max_total_weight = (200 * median_weight)/100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
std::unordered_set<crypto::key_image> k_images;

LOG_PRINT_L2("Filling block template, median weight " << median_weight << ", " << m_txs_by_fee_and_receive_time.size() << " txes in the pool");
Expand Down Expand Up @@ -1374,7 +1374,9 @@ namespace cryptonote
MFATAL("Failed to insert key images from txpool tx");
return false;
}
m_txs_by_fee_and_receive_time.emplace(std::pair<double, time_t>(meta.fee / (double)meta.weight, meta.receive_time), txid);
// Rounding tx fee/blob_size ratio so that txs with the same priority would be sorted by receive_time
uint32_t fee_per_size_ratio = (uint32_t)(meta.fee / (double)meta.weight);
m_txs_by_fee_and_receive_time.emplace(std::pair<uint32_t, std::time_t>(fee_per_size_ratio, meta.receive_time), txid);
m_txpool_weight += meta.weight;
return true;
}, true);
Expand Down
2 changes: 1 addition & 1 deletion src/cryptonote_core/tx_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace cryptonote
/************************************************************************/

//! pair of <transaction fee, transaction hash> for organization
typedef std::pair<std::pair<double, std::time_t>, crypto::hash> tx_by_fee_and_receive_time_entry;
typedef std::pair<std::pair<uint32_t, std::time_t>, crypto::hash> tx_by_fee_and_receive_time_entry;

class txCompare
{
Expand Down
5 changes: 5 additions & 0 deletions src/cryptonote_protocol/cryptonote_protocol_handler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ namespace cryptonote

if(m_core.have_block(hshd.top_id))
{
if (target > hshd.current_height)
{
MINFO(context << "peer is not ahead of us and we're syncing, disconnecting");
return false;
}
context.m_state = cryptonote_connection_context::state_normal;
if(is_inital && target == m_core.get_current_blockchain_height())
on_connection_synchronized();
Expand Down
8 changes: 6 additions & 2 deletions src/p2p/net_node.inl
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,10 @@ namespace nodetool
}
if(!context.m_is_income)
m_network_zones.at(context.m_remote_address.get_zone()).m_peerlist.set_peer_just_seen(context.peer_id, context.m_remote_address, context.m_pruning_seed, context.m_rpc_port);
m_payload_handler.process_payload_sync_data(rsp.payload_data, context, false);
if (!m_payload_handler.process_payload_sync_data(rsp.payload_data, context, false))
{
m_network_zones.at(context.m_remote_address.get_zone()).m_net_server.get_config_object().close(context.m_connection_id );
}
});

if(!r)
Expand Down Expand Up @@ -1091,6 +1094,7 @@ namespace nodetool
LOG_PRINT_CC_PRIORITY_NODE(is_priority, *con, "Failed to HANDSHAKE with peer "
<< na.str()
/*<< ", try " << try_count*/);
zone.m_net_server.get_config_object().close(con->m_connection_id);
return false;
}

Expand Down Expand Up @@ -1150,7 +1154,7 @@ namespace nodetool
bool is_priority = is_priority_node(na);

LOG_PRINT_CC_PRIORITY_NODE(is_priority, *con, "Failed to HANDSHAKE with peer " << na.str());

zone.m_net_server.get_config_object().close(con->m_connection_id);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define DEF_SUMOKOIN_VERSION_TAG "@VERSIONTAG@"
#define DEF_SUMOKOIN_VERSION "0.5.1.0"
#define DEF_SUMOKOIN_VERSION "0.5.1.1"
#define DEF_SUMOKOIN_RELEASE_NAME "Morioka"
#define DEF_SUMOKOIN_VERSION_FULL DEF_SUMOKOIN_VERSION "-" DEF_SUMOKOIN_VERSION_TAG

Expand Down
2 changes: 0 additions & 2 deletions src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7687,7 +7687,6 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
uint64_t num_found = 0;

// if we have a known ring, use it
bool existing_ring_found = false;
if (td.m_key_image_known && !td.m_key_image_partial)
{
std::vector<uint64_t> ring;
Expand All @@ -7699,7 +7698,6 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
std::to_string(ring.size()) + ", it cannot be spent now with ring size " +
std::to_string(fake_outputs_count + 1) + " as it is smaller: use a higher ring size");
bool own_found = false;
existing_ring_found = true;
for (const auto &out: ring)
{
MINFO("Ring has output " << out);
Expand Down

0 comments on commit 7b3bf97

Please sign in to comment.