git ssb

4+

Dominic / scuttlebot



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.jschanged
plugins/replicate.jsView
@@ -126,13 +126,15 @@
126126 opts.meta = true
127127
128128 function localPeers () {
129129 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 + })
135137 }
136138
137139 //also request local peers.
138140 if (sbot.gossip) {

Built with git-ssb-web