Bugfix: properly handle refused bootstrap connection (#3959)
If we currently refuse a bootstrap connection we debug assert due to a missed return code check. This commit fixes that.
This commit is contained in:
parent
1e92800e8e
commit
cbb120b1bb
1 changed files with 6 additions and 2 deletions
|
@ -263,7 +263,11 @@ bool nano::bootstrap_server::process_message (std::unique_ptr<nano::message> mes
|
|||
if (allow_bootstrap)
|
||||
{
|
||||
// Switch to bootstrap connection mode and handle message in subsequent bootstrap visitor
|
||||
to_bootstrap_connection ();
|
||||
if (!to_bootstrap_connection ())
|
||||
{
|
||||
stop ();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -288,7 +292,7 @@ bool nano::bootstrap_server::process_message (std::unique_ptr<nano::message> mes
|
|||
}
|
||||
return true;
|
||||
}
|
||||
// It is possible for server to switch to bootstrap mode immediately after processing handshake, thus no `else if`
|
||||
// the server will switch to bootstrap mode immediately after processing the first bootstrap message, thus no `else if`
|
||||
if (is_bootstrap_connection ())
|
||||
{
|
||||
bootstrap_message_visitor bootstrap_visitor{ shared_from_this () };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue