Skip to content

Commit

Permalink
eth, eth/protocols/eth: transaction announcements for ETH66 only as t…
Browse files Browse the repository at this point in the history
…he previous metadium protocol version was ETH65
  • Loading branch information
sadoci committed Nov 12, 2021
1 parent a992c50 commit b89baa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion eth/protocols/eth/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func NewPeer(version uint, p *p2p.Peer, rw p2p.MsgReadWriter, txpool TxPool) *Pe
// Start up all the broadcasters
go peer.broadcastBlocks()
go peer.broadcastTransactions()
if version >= ETH65 {
if version >= ETH66 {
go peer.announceTransactions()
}
return peer
Expand Down
4 changes: 2 additions & 2 deletions eth/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (h *handler) syncTransactions(p *eth.Peer) {
// The eth/65 protocol introduces proper transaction announcements, so instead
// of dripping transactions across multiple peers, just send the entire list as
// an announcement and let the remote side decide what they need (likely nothing).
if p.Version() >= eth.ETH65 {
if p.Version() > eth.ETH65 {
hashes := make([]common.Hash, len(txs))
for i, tx := range txs {
hashes[i] = tx.Hash()
Expand Down Expand Up @@ -97,7 +97,7 @@ func (h *handler) txsyncLoop64() {

// send starts a sending a pack of transactions from the sync.
send := func(s *txsync) {
if s.p.Version() >= eth.ETH65 {
if s.p.Version() > eth.ETH65 {
panic("initial transaction syncer running on eth/65+")
}
// Fill pack with transactions up to the target size.
Expand Down

0 comments on commit b89baa7

Please sign in to comment.