Skip to content

Commit

Permalink
peer: Add DisableRelayTx to config.
Browse files Browse the repository at this point in the history
Upstream commit 2a7f41c.
  • Loading branch information
davecgh committed May 26, 2016
2 parents 42550a5 + 2a7f41c commit f0389a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ type Config struct {
// peer.MaxProtocolVersion will be used.
ProtocolVersion uint32

// DisableRelayTx specifies if the remote peer should be informed to
// not send inv messages for transactions.
DisableRelayTx bool

// Listeners houses callback functions to be invoked on receiving peer
// messages.
Listeners MessageListeners
Expand Down Expand Up @@ -806,6 +810,9 @@ func (p *Peer) pushVersionMsg() error {
// Advertise our max supported protocol version.
msg.ProtocolVersion = int32(p.ProtocolVersion())

// Advertise if inv messages for transactions are desired.
msg.DisableRelayTx = p.cfg.DisableRelayTx

p.QueueMessage(msg, nil)
return nil
}
Expand Down
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,7 @@ func newPeerConfig(sp *serverPeer) *peer.Config {
UserAgentVersion: userAgentVersion,
ChainParams: sp.server.chainParams,
Services: sp.server.services,
DisableRelayTx: false,
}
}

Expand Down

0 comments on commit f0389a3

Please sign in to comment.