mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-29 13:28:11 +03:00
Try to fix server
This commit is contained in:
parent
e7eec45e85
commit
40c751ba72
@ -206,24 +206,26 @@ public:
|
||||
: acceptor_(io_service, tcp::endpoint(tcp::v4(), port)),
|
||||
socket_(io_service)
|
||||
{
|
||||
io_service_ = &io_service;
|
||||
do_accept();
|
||||
}
|
||||
|
||||
private:
|
||||
void do_accept()
|
||||
{
|
||||
acceptor_.async_accept(socket_,
|
||||
this->socket_ = tcp::socket(*io_service_);
|
||||
acceptor_.async_accept(this->socket_,
|
||||
[this](boost::system::error_code ec)
|
||||
{
|
||||
if (!ec)
|
||||
{
|
||||
std::make_shared<session>(std::move(socket_))->start();
|
||||
std::make_shared<session>(std::move(this->socket_))->start();
|
||||
}
|
||||
|
||||
do_accept();
|
||||
});
|
||||
}
|
||||
|
||||
boost::asio::io_service* io_service_;
|
||||
tcp::acceptor acceptor_;
|
||||
tcp::socket socket_;
|
||||
};
|
||||
|
@ -22,7 +22,7 @@ class TestSimulation:
|
||||
start = time.time()
|
||||
while time.time() - start < 100:
|
||||
if max([h.height for h in node1.blockchain.get_current_tips()]) > 10:
|
||||
return
|
||||
break
|
||||
await asyncio.sleep(1)
|
||||
tip_heights = [t.height for t in node1.blockchain.get_current_tips()]
|
||||
assert max(tip_heights) > 5
|
||||
|
Loading…
Reference in New Issue
Block a user