Skip to content

Commit

Permalink
Fix panic when peer doesn't have block (#1303)
Browse files Browse the repository at this point in the history
* Fix panic when peer doesn't have block

* PR link
  • Loading branch information
tomaka authored Nov 5, 2023
1 parent f531a33 commit 2eee81b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions light-base/src/sync_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ impl<TPlat: PlatformRef> SyncService<TPlat> {
)
.await
{
Ok(b) => b,
Err(_) => continue,
Ok(b) if !b.is_empty() => b,
Ok(_) | Err(_) => continue,
};

return Ok(result.remove(0));
Expand Down Expand Up @@ -404,8 +404,8 @@ impl<TPlat: PlatformRef> SyncService<TPlat> {
)
.await
{
Ok(b) => b,
Err(_) => continue,
Ok(b) if !b.is_empty() => b,
Ok(_) | Err(_) => continue,
};

return Ok(result.remove(0));
Expand Down
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed

- Fix panic when requesting a block with a specific hash from the peer-to-peer network and none of the peers has the block. ([#1303](https://github.com/smol-dot/smoldot/pull/1303))

## 2.0.7 - 2023-11-02

### Changed
Expand Down

0 comments on commit 2eee81b

Please sign in to comment.