Skip to content

Commit

Permalink
Document a state_contains bug (#1715)
Browse files Browse the repository at this point in the history
* Document a state_contains bug in the syncer and Inbound
  • Loading branch information
teor2345 authored Feb 9, 2021
1 parent 0c5daa8 commit 0b76352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions zebrad/src/components/inbound/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ where

let fut = async move {
// Check if the block is already in the state.
// BUG: check if the hash is in any chain (#862).
// Depth only checks the main chain.
match state.oneshot(zs::Request::Depth(hash)).await {
Ok(zs::Response::Depth(None)) => Ok(()),
Ok(zs::Response::Depth(Some(_))) => Err("already present".into()),
Expand Down
3 changes: 2 additions & 1 deletion zebrad/src/components/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ where
/// Returns `true` if the hash is present in the state, and `false`
/// if the hash is not present in the state.
///
/// TODO: handle multiple tips in the state.
/// BUG: check if the hash is in any chain (#862)
/// Depth only checks the main chain.
async fn state_contains(&mut self, hash: block::Hash) -> Result<bool, Report> {
match self
.state
Expand Down

0 comments on commit 0b76352

Please sign in to comment.