Commit 914d63f60ab342cedc1338cfc3c8f4d1a90ddcb2
fix bug replicating with local peers
taken from https://github.com/ssbc/patchwork/commit/0b9adb1dfcfd2248f55f9dc2130f2d53aeb91794 @mmckegg and i have no idea _exactly_ why an error happens without this, only that it somehow fixes something. yikes.Michael Williams committed on 3/23/2017, 9:08:22 AM
Parent: 69b8119e750167656adf12fb6f0ffdf0a2d8e099
Files changed
plugins/replicate.js | changed |
plugins/replicate.js | ||
---|---|---|
@@ -126,13 +126,15 @@ | ||
126 | 126 … | opts.meta = true |
127 | 127 … | |
128 | 128 … | function localPeers () { |
129 | 129 … | if(!sbot.gossip) return |
130 | - sbot.gossip.peers() | |
131 | - .forEach(function (e) { | |
132 | - if(to_send[e.key] == null) | |
133 | - addPeer({id: e.key, sequence: 0}) | |
134 | - }) | |
130 … | + sbot.gossip.peers().forEach(function (e) { | |
131 … | + if (e.source === 'local' && to_send[e.key] == null) { | |
132 … | + sbot.latestSequence(e.key, function (err, seq) { | |
133 … | + addPeer({id: e.key, sequence: err ? 0 : toSeq(seq)}) | |
134 … | + }) | |
135 … | + } | |
136 … | + }) | |
135 | 137 … | } |
136 | 138 … | |
137 | 139 … | //also request local peers. |
138 | 140 … | if (sbot.gossip) { |
Built with git-ssb-web