Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments, style. #676

Merged
merged 1 commit into from
Aug 21, 2024
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
2 changes: 1 addition & 1 deletion include/bitcoin/node/block_arena.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace libbitcoin {
namespace node {

/// Thread UNSAFE linked-linear memory arena.
/// Thread UNSAFE detachable linked-linear memory arena.
class BCN_API block_arena final
: public arena
{
Expand Down
9 changes: 8 additions & 1 deletion include/bitcoin/node/full_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ namespace libbitcoin {
namespace node {

/// Thread safe.
/// WARNING: when full node is using block_memory controller, all shared block
/// components invalidate when the block destructs. Lifetime of the block is
/// assured for the extent of all methods below, however if a sub-object is
/// retained by shared_ptr, beyond method completion, a copy of the block
/// shared_ptr must also be be retained. Taking a block or sub-object copy is
/// insufficient, as copies are shallow (copy internal shared_ptr objects).
class BCN_API full_node
: public network::p2p
{
public:
using memory_controller = block_memory;
using store = node::store;
using query = node::query;
typedef std::shared_ptr<full_node> ptr;
Expand Down Expand Up @@ -166,10 +173,10 @@ class BCN_API full_node

// These are thread safe.
const configuration& config_;
memory_controller memory_;
query& query_;

// These are protected by strand.
block_memory memory_;
chaser_block chaser_block_;
chaser_header chaser_header_;
chaser_check chaser_check_;
Expand Down
1 change: 0 additions & 1 deletion include/bitcoin/node/sessions/attach.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class attach
network::channel::ptr create_channel(const network::socket::ptr& socket,
bool quiet) NOEXCEPT override
{
// This memory arena is NOT thread safe.
return std::make_shared<network::channel>(session::get_memory(),
network::session::log, socket, network::session::settings(),
network::session::create_key(), quiet);
Expand Down
3 changes: 1 addition & 2 deletions src/full_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ full_node::full_node(query& query, const configuration& configuration,
const logger& log) NOEXCEPT
: p2p(configuration.network, log),
config_(configuration),
memory_(config_.node.allocation_multiple, config_.network.threads),
query_(query),
memory_(configuration.node.allocation_multiple,
configuration.network.threads),
chaser_block_(*this),
chaser_header_(*this),
chaser_check_(*this),
Expand Down
Loading