@@ -158,18 +158,6 @@ func (n *OpenBazaarNode) SeedNode() error {
158
158
}
159
159
n .RootHash = rootHash
160
160
161
- go func () {
162
- // Ping search endpoint with published hash
163
- peerId , _ := n .GetNodeID ()
164
- endpoint := fmt .Sprintf ("https://search.ob1.io/ping/%s/%s" , peerId .PeerID , rootHash )
165
- log .Infof ("Publishing new rootHash to: %s\n " , endpoint )
166
- resp , err := http .Get (endpoint )
167
- if err != nil {
168
- log .Errorf ("Search Ping did not succeed. %v\n " , err )
169
- }
170
- log .Debugf ("%s respone: %v" , endpoint , resp )
171
- }()
172
-
173
161
n .seedLock .Unlock ()
174
162
n .InitalPublishComplete = true
175
163
go n .publish (rootHash )
@@ -195,6 +183,27 @@ func (n *OpenBazaarNode) publish(hash string) {
195
183
return
196
184
}
197
185
186
+ go func () {
187
+ // Update search endpoint with published hash
188
+ peerId , _ := n .GetNodeID ()
189
+ endpoint := fmt .Sprintf ("https://search.ob1.io/update/%s/%s" , peerId .PeerID , hash )
190
+ log .Infof ("Publishing new rootHash to: %s\n " , endpoint )
191
+
192
+ var client * http.Client
193
+ if n .TorDialer != nil {
194
+ tbTransport := & http.Transport {Dial : n .TorDialer .Dial }
195
+ client = & http.Client {Transport : tbTransport , Timeout : time .Second * 30 }
196
+ } else {
197
+ client = & http.Client {Timeout : time .Second * 30 }
198
+ }
199
+
200
+ resp , err := client .Get (endpoint )
201
+ if err != nil {
202
+ log .Errorf ("Search update did not succeed. %v\n " , err )
203
+ }
204
+ log .Debugf ("%s response: %v" , endpoint , resp )
205
+ }()
206
+
198
207
inflightPublishRequests ++
199
208
err = ipfs .Publish (n .IpfsNode , hash )
200
209
0 commit comments