Document a state_contains bug (#1715)

* Document a state_contains bug in the syncer and Inbound
This commit is contained in:
teor 2021-02-10 09:05:14 +10:00 committed by GitHub
parent 0c5daa8410
commit 0b76352468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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()),

View File

@ -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