peer: Add DisableRelayTx to config.
DisableRelayTx sets the DisableRelayTx value in the version message which informs the remote peer on whether to send inv messages for transactions.
This commit is contained in:
parent
ce981f45c2
commit
2a7f41cddb
2 changed files with 8 additions and 0 deletions
|
@ -235,6 +235,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
|
||||
|
@ -798,6 +802,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
|
||||
}
|
||||
|
|
|
@ -1403,6 +1403,7 @@ func newPeerConfig(sp *serverPeer) *peer.Config {
|
|||
UserAgentVersion: userAgentVersion,
|
||||
ChainParams: sp.server.chainParams,
|
||||
Services: sp.server.services,
|
||||
DisableRelayTx: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue