helia-coord 1.5.6 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,6 +69,10 @@ class EncryptionAdapter {
|
|
|
69
69
|
try {
|
|
70
70
|
// console.log('peer: ', peer)
|
|
71
71
|
|
|
72
|
+
if (!peer || !peer.data) {
|
|
73
|
+
throw new Error('Peer public key is not available yet.')
|
|
74
|
+
}
|
|
75
|
+
|
|
72
76
|
const pubKey = peer.data.encryptPubKey
|
|
73
77
|
// console.log('msg to encrypt: ', msg)
|
|
74
78
|
// console.log(`Encrypting with public key: ${pubKey}`)
|
|
@@ -180,7 +180,7 @@ class Messaging {
|
|
|
180
180
|
|
|
181
181
|
return retObj
|
|
182
182
|
} catch (err) {
|
|
183
|
-
console.error('Error in helia-coord/lib/adpaters/pubsub-adapter/
|
|
183
|
+
console.error('Error in helia-coord/lib/adpaters/pubsub-adapter/messaging.js/handleIncomingData(): ', err)
|
|
184
184
|
|
|
185
185
|
// Do not throw an error. This is a top-level function called by an Interval.
|
|
186
186
|
return false
|
|
@@ -238,6 +238,13 @@ class Messaging {
|
|
|
238
238
|
|
|
239
239
|
const peerData = thisNode.peerData.filter(x => x.from === receiver)
|
|
240
240
|
|
|
241
|
+
// 3/24/24 CT - Debugging issue with passing data between ipfs-bch-wallet
|
|
242
|
+
// -service and -consumer.
|
|
243
|
+
if (!peerData[0].data) {
|
|
244
|
+
console.log(`peerData[0]: ${JSON.stringify(peerData[0])}`)
|
|
245
|
+
throw new Error('Required encryption information for peer is not available.')
|
|
246
|
+
}
|
|
247
|
+
|
|
241
248
|
// Encrypt the string with the peers public key.
|
|
242
249
|
const payload = await this.encryption.encryptMsg(
|
|
243
250
|
peerData[0],
|
package/package.json
CHANGED