Merge of #8460
This commit is contained in:
commit
2b4af9f2e4
|
@ -1098,6 +1098,11 @@ where
|
||||||
data: None,
|
data: None,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
// # Concurrency
|
||||||
|
//
|
||||||
|
// For consistency, this lookup must be performed first, then all the other
|
||||||
|
// lookups must be based on the hash.
|
||||||
|
|
||||||
// Fetch the block referenced by [`hash_or_height`] from the state.
|
// Fetch the block referenced by [`hash_or_height`] from the state.
|
||||||
// TODO: If this RPC is called a lot, just get the block header,
|
// TODO: If this RPC is called a lot, just get the block header,
|
||||||
// rather than the whole block.
|
// rather than the whole block.
|
||||||
|
@ -1128,6 +1133,9 @@ where
|
||||||
_ => unreachable!("unmatched response to a block request"),
|
_ => unreachable!("unmatched response to a block request"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let hash = hash_or_height.hash().unwrap_or_else(|| block.hash());
|
||||||
|
let hash_or_height = hash.into();
|
||||||
|
|
||||||
// Fetch the Sapling & Orchard treestates referenced by
|
// Fetch the Sapling & Orchard treestates referenced by
|
||||||
// [`hash_or_height`] from the state.
|
// [`hash_or_height`] from the state.
|
||||||
|
|
||||||
|
@ -1156,8 +1164,6 @@ where
|
||||||
// We've got all the data we need for the RPC response, so we
|
// We've got all the data we need for the RPC response, so we
|
||||||
// assemble the response.
|
// assemble the response.
|
||||||
|
|
||||||
let hash = block.hash();
|
|
||||||
|
|
||||||
let height = block
|
let height = block
|
||||||
.coinbase_height()
|
.coinbase_height()
|
||||||
.expect("verified blocks have a valid height");
|
.expect("verified blocks have a valid height");
|
||||||
|
|
Loading…
Reference in New Issue