Skip to content

Commit

Permalink
relocate broadcast logic (#656)
Browse files Browse the repository at this point in the history
Co-authored-by: 賴怡誠 <[email protected]>
  • Loading branch information
liam-lai and 賴怡誠 authored Oct 1, 2024
1 parent 9751e41 commit ccbedce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions eth/bft/bft_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down

0 comments on commit ccbedce

Please sign in to comment.