Skip to content

Commit

Permalink
Merge pull request #153 from subspace/fix-block-body-todo
Browse files Browse the repository at this point in the history
`block.body` definitly exists unless it's a light client or using fast sync in storage chain mode
  • Loading branch information
liuchengxu authored Nov 26, 2021
2 parents 1ff36db + edb1a71 commit db4639f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/sc-consensus-subspace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,9 +1489,12 @@ where
let root_blocks = self.root_blocks.lock();
// If there are root blocks expected to be included in this block, check them
if let Some(correct_root_blocks) = root_blocks.peek(&block_number) {
// TODO: Why there could be no body? Light client?
let mut found = false;
for extrinsic in block.body.as_ref().unwrap() {
for extrinsic in block
.body
.as_ref()
.expect("Light client or fast sync is unsupported; qed")
{
match self
.client
.runtime_api()
Expand Down

0 comments on commit db4639f

Please sign in to comment.