Skip to content

Commit

Permalink
Fix network_service discarding events (#967)
Browse files Browse the repository at this point in the history
* Fix network_service discarding events

* PR link
  • Loading branch information
tomaka authored Jul 26, 2023
1 parent 172784c commit 1702f17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions light-base/src/network_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,10 +988,11 @@ async fn background_task<TPlat: PlatformRef>(mut task: BackgroundTask<TPlat>) {
async { WhatHappened::Message(task.messages_rx.next().await.unwrap()) };
let can_generate_event = matches!(task.event_senders, either::Left(_));
let service_event = async {
if let (true, Some(event)) = (
can_generate_event,
task.network.next_event(task.platform.now()),
) {
if let Some(event) = if can_generate_event {
task.network.next_event(task.platform.now())
} else {
None
} {
WhatHappened::NetworkEvent(event)
} else if let Some(start_connect) =
task.network.next_start_connect(|| task.platform.now())
Expand Down
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- A JSON-RPC error is now returned if the JSON-RPC client tries to open more than two simultaneous `chainHead_unstable_follow` subscriptions, in accordance with the latest changes in the JSON-RPC API specification. ([#962](https://github.com/smol-dot/smoldot/pull/962))
- Rename `chainHead_unstable_storageContinue` to `chainHead_unstable_continue`, in accordance with the latest changes in the JSON-RPC API specification. ([#965](https://github.com/smol-dot/smoldot/pull/965))

### Fixed

- Fix several potential panics due to mismatches in the state of the networking. ([#967](https://github.com/smol-dot/smoldot/pull/967))

## 1.0.13 - 2023-07-16

### Added
Expand Down

0 comments on commit 1702f17

Please sign in to comment.