Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit fe7cc22

Browse files
richardschneiderdaviddias
authored andcommittedNov 20, 2017
fix: allow topicCIDs from older peers (#631)
1 parent 5782b2d commit fe7cc22

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎src/pubsub.js

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ module.exports = (arg) => {
121121
function subscribe (topic, options, handler, callback) {
122122
ps.on(topic, handler)
123123
if (subscriptions[topic]) {
124+
// TODO: should a callback error be returned?
124125
return callback()
125126
}
126127

‎src/utils/pubsub-message-utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ function deserializeFromBase64 (obj) {
3030
from: bs58.encode(Buffer.from(obj.from, 'base64')).toString(),
3131
seqno: Buffer.from(obj.seqno, 'base64'),
3232
data: Buffer.from(obj.data, 'base64'),
33-
topicIDs: obj.topicIDs
33+
topicIDs: obj.topicIDs || obj.topicCIDs
3434
}
3535
}
3636

3737
function isPubsubMessage (obj) {
38-
return obj && obj.from && obj.seqno && obj.data && obj.topicIDs
38+
return obj && obj.from && obj.seqno && obj.data && (obj.topicIDs || obj.topicCIDs)
3939
}

0 commit comments

Comments
 (0)
This repository has been archived.