From 3b75a57efd3422c03b24dbeae78ea8333bc6478b Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 17 Jul 2024 09:54:08 +0200 Subject: [PATCH] Fix state mismatch in async_tree.rs (#1912) * Fix state mismatch in async_tree.rs * PR link --- lib/src/chain/async_tree.rs | 4 +++- wasm-node/CHANGELOG.md | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/chain/async_tree.rs b/lib/src/chain/async_tree.rs index 7e9b2cb5f4..2c97c76f07 100644 --- a/lib/src/chain/async_tree.rs +++ b/lib/src/chain/async_tree.rs @@ -788,7 +788,9 @@ where }, ); - self.input_best_block_index = Some(new_index); + if is_new_best { + self.input_best_block_index = Some(new_index); + } new_index } diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index 9b617d30bc..aee3a8d193 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixed + +- Fix potential panic in parachain syncing code. ([#1912](https://github.com/smol-dot/smoldot/pull/1912)) + ## 2.0.29 - 2024-06-17 ### Fixed