Skip to content

Commit

Permalink
Fix for nested reorg situation
Browse files Browse the repository at this point in the history
  • Loading branch information
longfin committed Sep 10, 2020
1 parent 2aba33f commit 0815f28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ To be released.
reconnecting. [[#957], [#972]]
- Fixed a bug that `Swarm<T>` had not received block headers after failing
to recevie previous blocks. [[#996]]
- Fixed a bug that `Swarm<T>` had thrown `InvalidGenesisBlockException`
when reorganizing repeatedly. [[#996]]

### CLI tools

Expand Down
5 changes: 1 addition & 4 deletions Libplanet/Net/Swarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1810,10 +1810,7 @@ out HashDigest<SHA256> branchPoint
{
_logger.Debug("It doesn't need to fork.");
}

// We can omit this clause if assume every chain shares
// same genesis block...
else if (!BlockChain.ContainsBlock(branchPoint))
else if (!workspace.ContainsBlock(branchPoint))
{
// FIXME: This behavior can unexpectedly terminate the swarm (and the game
// app) if it encounters a peer having a different blockchain, and therefore
Expand Down

0 comments on commit 0815f28

Please sign in to comment.