Limit max number of queued blocks from ascending bootstrap
This commit is contained in:
parent
876c91b3ea
commit
301a418e22
1 changed files with 3 additions and 3 deletions
|
@ -194,9 +194,9 @@ void nano::bootstrap_ascending::service::inspect (store::transaction const & tx,
|
|||
void nano::bootstrap_ascending::service::wait_blockprocessor ()
|
||||
{
|
||||
nano::unique_lock<nano::mutex> lock{ mutex };
|
||||
while (!stopped && block_processor.half_full ())
|
||||
while (!stopped && block_processor.size () > 1000)
|
||||
{
|
||||
condition.wait_for (lock, 500ms, [this] () { return stopped; }); // Blockprocessor is relatively slow, sleeping here instead of using conditions
|
||||
condition.wait_for (lock, std::chrono::milliseconds{ config.bootstrap_ascending.throttle_wait }, [this] () { return stopped; }); // Blockprocessor is relatively slow, sleeping here instead of using conditions
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ std::shared_ptr<nano::transport::channel> nano::bootstrap_ascending::service::wa
|
|||
nano::unique_lock<nano::mutex> lock{ mutex };
|
||||
while (!stopped && !(channel = scoring.channel ()))
|
||||
{
|
||||
condition.wait_for (lock, 100ms, [this] () { return stopped; });
|
||||
condition.wait_for (lock, std::chrono::milliseconds{ config.bootstrap_ascending.throttle_wait }, [this] () { return stopped; });
|
||||
}
|
||||
return channel;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue