mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
relocate broadcast logic (#656)
Co-authored-by: 賴怡誠 <laiyicheng@makotos-MBP.lan>
This commit is contained in:
parent
9751e41dd5
commit
ccbedce27b
2 changed files with 4 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
const maxBlockDist = 7 // Maximum allowed backward distance from the chain head, 7 is just a magic number indicate very close block
|
||||
|
||||
//Define Boradcast Group functions
|
||||
// Define Boradcast Group functions
|
||||
type broadcastVoteFn func(*types.Vote)
|
||||
type broadcastTimeoutFn func(*types.Timeout)
|
||||
type broadcastSyncInfoFn func(*types.SyncInfo)
|
||||
|
|
@ -126,8 +126,8 @@ func (b *Bfter) Timeout(peer string, timeout *types.Timeout) error {
|
|||
return err
|
||||
}
|
||||
|
||||
b.broadcastCh <- timeout
|
||||
if verified {
|
||||
b.broadcastCh <- timeout
|
||||
err = b.consensus.timeoutHandler(b.blockChainReader, timeout)
|
||||
if err != nil {
|
||||
if _, ok := err.(*utils.ErrIncomingMessageRoundNotEqualCurrentRound); ok {
|
||||
|
|
@ -156,9 +156,9 @@ func (b *Bfter) SyncInfo(peer string, syncInfo *types.SyncInfo) error {
|
|||
return err
|
||||
}
|
||||
|
||||
b.broadcastCh <- syncInfo
|
||||
// Process only if verified and qualified
|
||||
if verified {
|
||||
b.broadcastCh <- syncInfo
|
||||
err = b.consensus.syncInfoHandler(b.blockChainReader, syncInfo)
|
||||
if err != nil {
|
||||
log.Error("handle BFT SyncInfo", "error", err)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import (
|
|||
const (
|
||||
VersionMajor = 2 // Major version component of the current release
|
||||
VersionMinor = 2 // Minor version component of the current release
|
||||
VersionPatch = 0 // Patch version component of the current release
|
||||
VersionPatch = 1 // Patch version component of the current release
|
||||
VersionMeta = "stable" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue