Skip to content

Commit

Permalink
Add the batch of release v3.2.3 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-at-bcn committed Aug 13, 2018
1 parent 25e429a commit 31eb6a7
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 15 deletions.
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Release Notes

### v3.2.3

- Fixed issues in SQLite logic in x86-32 daemons.
- Fixed a bug in the downloader, which hinders normal downloading blocks.

### v3.2.2

- Fixed an output bufferization issue in the `bytecoind` daemon.
Expand Down
4 changes: 3 additions & 1 deletion src/Core/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Archive::Archive(bool read_only, const std::string &path)
: read_only(read_only)
// , commit_timer(std::bind(&Archive::db_commit, this))
{
try {
#if !platform_USE_SQLITE
try {
m_db = std::make_unique<DB>(read_only, path);
if (!m_db->get("$unique_id", unique_id)) {
DB::Cursor cur = m_db->begin(std::string());
Expand All @@ -47,6 +48,7 @@ Archive::Archive(bool read_only, const std::string &path)
else
throw;
}
#endif
// commit_timer.once(DB_COMMIT_PERIOD);
}

Expand Down
16 changes: 5 additions & 11 deletions src/Core/BlockChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,13 @@ std::vector<Hash> BlockChain::get_sync_headers_chain(const std::vector<Hash> &lo
api::BlockHeader header;
if (!read_header(lit, &header))
continue;
if (header.height > m_tip_height) { // Asker has better chain then we do
*start_height = m_tip_height + 1;
return result;
}
uint32_t min_height = header.height;
Hash loc_ha = lit;
for (; min_height != 0; min_height -= 1) {
Hash ha = read_chain(min_height);
if (ha == loc_ha)
while (header.height != 0) {
Hash ha;
if(read_chain(header.height, &ha) && ha == header.hash)

This comment has been minimized.

Copy link
@LouisWayne

LouisWayne Aug 16, 2018

Spacing if( -> if (

break;
loc_ha = header.previous_block_hash;
header = read_header(loc_ha);
header = read_header(header.previous_block_hash);
}
uint32_t min_height = header.height;
*start_height = min_height;
for (; result.size() < max_count && min_height <= m_tip_height; min_height += 1) {
result.push_back(read_chain(min_height));
Expand Down
2 changes: 2 additions & 0 deletions src/Core/BlockChainState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,8 @@ AddTransactionResult BlockChainState::add_transaction(const Hash &tid, const Tra
if (read_keyimage(in.key_image, conflict_height)) {
// std::cout << tid << " " << in.key_image <<
// std::endl;
m_log(logging::WARNING) << "OUTPUT_ALREADY_SPENT in transaction " << tid
<< std::endl; // TODO - remove
return AddTransactionResult::OUTPUT_ALREADY_SPENT; // Already spent in main chain
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/Core/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ void Node::P2PClientBytecoin::on_msg_notify_checkpoint(NOTIFY_CHECKPOINT::reques
<< std::endl;
BinaryArray raw_msg = LevinProtocol::send_message(NOTIFY_CHECKPOINT::ID, LevinProtocol::encode(req), false);
m_node->m_p2p.broadcast(nullptr, raw_msg); // nullptr, not this - so a sender sees "reflection" of message
COMMAND_TIMED_SYNC::request ts_req;
ts_req.payload_data = CORE_SYNC_DATA{m_node->m_block_chain.get_tip_height(), m_node->m_block_chain.get_tip_bid()};
raw_msg = LevinProtocol::send_message(COMMAND_TIMED_SYNC::ID, LevinProtocol::encode(ts_req), true);
m_node->m_p2p.broadcast(nullptr, raw_msg);
m_node->advance_long_poll();
}

Expand Down
1 change: 1 addition & 0 deletions src/Core/NodeLegacyAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ void Node::getblocktemplate(const api::bytecoind::GetBlockTemplate::Request &req
res.blocktemplate_blob = block_blob;
res.top_block_hash = m_block_chain.get_tip_bid();
res.transaction_pool_version = m_block_chain.get_tx_pool_version();
res.previous_block_hash = m_block_chain.get_tip().previous_block_hash;
res.status = CORE_RPC_STATUS_OK;
}

Expand Down
1 change: 1 addition & 0 deletions src/Core/rpc_api_serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ void ser_members(bytecoin::api::bytecoind::GetBlockTemplate::Response &v, ISeria
seria_kv("status", v.status, s);
seria_kv("top_block_hash", v.top_block_hash, s);
seria_kv("transaction_pool_version", v.transaction_pool_version, s);
seria_kv("previous_block_hash", v.previous_block_hash, s);
}
void ser_members(bytecoin::api::bytecoind::GetCurrencyId::Response &v, ISeria &s) {
seria_kv("currency_id_blob", v.currency_id_blob, s);
Expand Down
4 changes: 4 additions & 0 deletions src/crypto/crypto-util.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Copyright (c) 2012-2018, The CryptoNote developers, The Bytecoin developers.
// Licensed under the GNU Lesser General Public License. See LICENSE for details.

// Copyright (c) 2013-2018
// Frank Denis <j at pureftpd dot org>
// See https://github.com/jedisct1/libsodium/blob/master/LICENSE for details

#include <memory.h>
#include <stdio.h>

Expand Down
4 changes: 4 additions & 0 deletions src/crypto/crypto-util.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Copyright (c) 2012-2018, The CryptoNote developers, The Bytecoin developers.
// Licensed under the GNU Lesser General Public License. See LICENSE for details.

// Copyright (c) 2013-2018
// Frank Denis <j at pureftpd dot org>
// See https://github.com/jedisct1/libsodium/blob/master/LICENSE for details

#pragma once

#include <stdint.h>
Expand Down
5 changes: 4 additions & 1 deletion src/platform/DBsqlite3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "DBsqlite3.hpp"
#include <boost/lexical_cast.hpp>
#include <iostream>
#include <common/Invariant.hpp>
#include "PathTools.hpp"
#include "common/string.hpp"

Expand Down Expand Up @@ -156,10 +157,12 @@ void DBsqlite::commit_db_txn() {
}

static void put(sqlite::Stmt &stmt, const std::string &key, const void *data, size_t size) {
invariant(data || size == 0, "");
sqlite3_reset(stmt.handle);
sqlite_check(
sqlite3_bind_blob(stmt.handle, 1, key.data(), static_cast<int>(key.size()), 0), "DB::put sqlite3_bind_blob 1 ");
sqlite_check(sqlite3_bind_blob(stmt.handle, 2, data, static_cast<int>(size), 0), "DB::put sqlite3_bind_blob 2 ");
sqlite_check(sqlite3_bind_blob(stmt.handle, 2, data ? data : "", static_cast<int>(size), 0), "DB::put sqlite3_bind_blob 2 ");
// sqlite3_bind_blob uses nullptr as a NULL indicator. Empty arrays can have nullptr as a data().
auto rc = sqlite3_step(stmt.handle);
if (rc != SQLITE_DONE)
throw platform::sqlite::Error("DB::put failed sqlite3_step in put " + common::to_string(rc));
Expand Down
1 change: 1 addition & 0 deletions src/rpc_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ struct GetBlockTemplate {
std::string status;
Hash top_block_hash; // for longpoll in v3 - behaves like GetStatus
uint32_t transaction_pool_version = 0; // for longpoll in v3 - behaves like GetStatus
Hash previous_block_hash; // Deprecated, used by some legacy miners.
};
};

Expand Down
4 changes: 2 additions & 2 deletions src/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#pragma once

// defines are for Windows resource compiler
#define bytecoin_VERSION_WINDOWS_COMMA 3, 18, 8, 6
#define bytecoin_VERSION_STRING "3.2.2"
#define bytecoin_VERSION_WINDOWS_COMMA 3, 18, 8, 13
#define bytecoin_VERSION_STRING "3.2.3"
#ifndef RC_INVOKED // Windows resource compiler

namespace bytecoin {
Expand Down

0 comments on commit 31eb6a7

Please sign in to comment.