-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't refresh sync peer when its head block is known (#3916)
* Don't refresh sync peer when its head block is known * refactor * Always refresh total difficulty * small fix * revert * PassBlockHint in hive * fix * fix * suggest block * Next attempt * fix * Revert "fix" This reverts commit 6269d06. * Revert "Next attempt" This reverts commit 4ac1046. * suggest block if body is empty, header if not * fix? * refactor & cleaning * rename method for more accurate * fix? * do not process suggested block * send whole block instead of hash * do not notify twice * Move logic to hive plugin Co-authored-by: Marcin Sobczak <marcindsobczak@gmail.com>
- Loading branch information
1 parent
1ad915a
commit b3ce2cd
Showing
6 changed files
with
83 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Nethermind/Nethermind.Synchronization/Peers/PeerHeadRefreshedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2021 Demerzel Solutions Limited | ||
// This file is part of the Nethermind library. | ||
// | ||
// The Nethermind library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// The Nethermind library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the Nethermind. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
using System; | ||
using Nethermind.Blockchain.Synchronization; | ||
using Nethermind.Core; | ||
|
||
namespace Nethermind.Synchronization.Peers; | ||
|
||
public class PeerHeadRefreshedEventArgs : EventArgs | ||
{ | ||
public ISyncPeer SyncPeer { get; } | ||
public BlockHeader Header { get; } | ||
|
||
public PeerHeadRefreshedEventArgs(ISyncPeer syncPeer, BlockHeader blockHeader) | ||
{ | ||
SyncPeer = syncPeer; | ||
Header = blockHeader; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters