Skip to content

Commit

Permalink
Merge pull request #4559 from filecoin-project/fix/beyond-genesis
Browse files Browse the repository at this point in the history
Fix random test failures
  • Loading branch information
magik6k committed Oct 23, 2020
2 parents c81db5a + 16a911b commit 8124fe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions chain/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,11 @@ loop:
}

base := blockSet[len(blockSet)-1]
if base.Equals(known) {
blockSet = blockSet[:len(blockSet)-1]
base = blockSet[len(blockSet)-1]
}

if base.IsChildOf(known) {
// common case: receiving blocks that are building on top of our best tipset
return blockSet, nil
Expand Down
2 changes: 1 addition & 1 deletion miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ minerLoop:
m.minedBlockHeights.Add(blkKey, true)

if err := m.api.SyncSubmitBlock(ctx, b); err != nil {
log.Errorf("failed to submit newly mined block: %s", err)
log.Errorf("failed to submit newly mined block: %+v", err)
}
} else {
base.NullRounds++
Expand Down

0 comments on commit 8124fe9

Please sign in to comment.