Skip to content
Merged
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: 0 additions & 1 deletion include/bitcoin/node/messages/block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct BCN_API block
{
typedef std::shared_ptr<const block> cptr;

static const network::messages::peer::identifier id;
static const std::string command;
static const uint32_t version_minimum;
static const uint32_t version_maximum;
Expand Down
1 change: 0 additions & 1 deletion include/bitcoin/node/messages/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ struct BCN_API transaction
{
typedef std::shared_ptr<const transaction> cptr;

static const network::messages::peer::identifier id;
static const std::string command;
static const uint32_t version_minimum;
static const uint32_t version_maximum;
Expand Down
6 changes: 6 additions & 0 deletions include/bitcoin/node/protocols/protocol_peer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class BCN_API protocol_peer
/// Determine if outgoing block or tx was previously announced by peer.
virtual bool was_announced(const system::hash_digest&) const NOEXCEPT;

/// Currency.
/// -----------------------------------------------------------------------

/// Set chain currency, which is not latched (channel buffer policy).
virtual void set_current(bool value) NOEXCEPT;

/// Events notification.
/// -----------------------------------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion src/messages/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ using namespace system;
using namespace network::messages::peer;

const std::string block::command = "block";
const identifier block::id = identifier::block;
const uint32_t block::version_minimum = level::minimum_protocol;
const uint32_t block::version_maximum = level::maximum_protocol;

Expand Down
1 change: 0 additions & 1 deletion src/messages/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ using namespace system;
using namespace network::messages::peer;

const std::string transaction::command = "tx";
const identifier transaction::id = identifier::transaction;
const uint32_t transaction::version_minimum = level::minimum_protocol;
const uint32_t transaction::version_maximum = level::maximum_protocol;

Expand Down
6 changes: 5 additions & 1 deletion src/protocols/protocol_block_in_31800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
// Commit block.txs.
// ........................................................................

if (const auto code = query.set_code(block, link, checked, bypass, height))
// Pruned nodes do not store input script or witness under bypass.
const auto prune = bypass && node_pruned_;
if (const auto code = query.set_code(block, link, checked, bypass, height,
prune))
{
LOGF("Failure storing block [" << encode_hash(hash) << ":" << height
<< "] from [" << opposite() << "] " << code.message());
Expand All @@ -353,6 +356,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
fire(events::block_archived, height);

count(block.serialized_size(true));
set_current(is_current_chain(true));
map_->erase(it);
if (is_idle())
{
Expand Down
5 changes: 5 additions & 0 deletions src/protocols/protocol_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ void protocol_peer::set_announced(const system::hash_digest& hash) NOEXCEPT
channel_->set_announced(hash);
}

void protocol_peer::set_current(bool value) NOEXCEPT
{
channel_->set_current(value);
}

bool protocol_peer::was_announced(const system::hash_digest& hash) const NOEXCEPT
{
return channel_->was_announced(hash);
Expand Down
Loading