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
2 changes: 1 addition & 1 deletion include/bitcoin/node/full_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class BCN_API full_node
/// -----------------------------------------------------------------------

/// Resume nework connections.
void resume() NOEXCEPT override;
bool resume() NOEXCEPT override;

/// Suspend all existing and future network connections.
/// A race condition can result in an unsuspended connection.
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/node/protocols/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class BCN_API protocol
/// Network suspension (does not affect administrative connections).
virtual bool suspended() const NOEXCEPT;
virtual void suspend(const code& ec) NOEXCEPT;
virtual void resume() NOEXCEPT;
virtual bool resume() NOEXCEPT;

/// Organizers.
/// -----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/node/sessions/session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class BCN_API session
/// Network suspension (does not affect administrative connections).
virtual bool suspended() const NOEXCEPT;
virtual void suspend(const code& ec) NOEXCEPT;
virtual void resume() NOEXCEPT;
virtual bool resume() NOEXCEPT;

/// Suspend all connections.
virtual void fault(const code& ec) NOEXCEPT;
Expand Down
12 changes: 9 additions & 3 deletions src/full_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,23 @@ void full_node::unsubscribe_chase(object_key key) NOEXCEPT
// Suspensions.
// ----------------------------------------------------------------------------

void full_node::resume() NOEXCEPT
bool full_node::resume() NOEXCEPT
{
if (query_.is_full())
{
LOGF("Cannot resume network, disk full.");
return false;
}

if (query_.is_fault())
{
LOGF("Cannot resume network, " << query_.get_fault());
return;
return false;
}

LOGS("Resuming network.");
notify(error::success, chase::resume, {});
net::resume();
return net::resume();
}

// This is just a best effort, the call may have to be repeated.
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ void protocol::suspend(const code& ec) NOEXCEPT
session_->suspend(ec);
}

void protocol::resume() NOEXCEPT
bool protocol::resume() NOEXCEPT
{
session_->resume();
return session_->resume();
}

// Organizers.
Expand Down
4 changes: 2 additions & 2 deletions src/sessions/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ void session::suspend(const code& ec) NOEXCEPT
node_.suspend(ec);
}

void session::resume() NOEXCEPT
bool session::resume() NOEXCEPT
{
node_.resume();
return node_.resume();
}

BC_POP_WARNING()
Expand Down
Loading