From 2244eb85970c0c60eeb91da15ed8c467611dd4cf Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 3 Oct 2019 17:37:29 +0100 Subject: [PATCH] Advertise your peer address as advertised address --- network/default.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network/default.go b/network/default.go index 8d482b24..78f48fd5 100644 --- a/network/default.go +++ b/network/default.go @@ -93,11 +93,14 @@ func newNetwork(opts ...Option) Network { // set the address to advertise var advertise string + var peerAddress string if len(options.Advertise) > 0 { advertise = options.Advertise + peerAddress = options.Advertise } else { advertise = options.Address + peerAddress = address } // server is network server @@ -122,7 +125,7 @@ func newNetwork(opts ...Option) Network { network := &network{ node: &node{ id: options.Id, - address: address, + address: peerAddress, peers: make(map[string]*node), }, options: options,