debugging preferred provider

This commit is contained in:
Chris Troutner
2023-02-13 07:22:29 -08:00
parent 00b76226ec
commit 9d80341357
+6
View File
@@ -214,6 +214,8 @@ class IpfsCoordAdapter {
// providers. This method is called periodically by a timer-interval.
pollForBchServices () {
try {
console.log('pollForBchServices() polling for BCH service')
// An array of IPFS IDs of other nodes in the coordination pubsub channel.
const peers = _this.ipfsCoord.thisNode.peerList
// console.log(`peers: ${JSON.stringify(peers, null, 2)}`)
@@ -255,6 +257,8 @@ class IpfsCoordAdapter {
console.log(`---->BCH wallet service selected: ${thisPeer}`)
}
console.log('preferredProvider: ', _this.config.preferredProvider)
// If a preferred provider is set in the config file, then connect
// to the preferred provider when it's discovered.
if (
@@ -264,6 +268,8 @@ class IpfsCoordAdapter {
_this.state.selectedServiceProvider = thisPeer
}
console.log('selectedServiceProvider: ', _this.state.selectedServiceProvider)
// Check if the peer has already been added to the list of providers.
const alreadyExists = _this.state.serviceProviders.filter(
(x) => x === thisPeer