git ssb

4+

Dominic / scuttlebot



Commit 243045ea3fb6700ba9693c23cceb779a53987e4b

Merge branch 'master' of github.com:ssbc/scuttlebot into _master

Dominic Tarr committed on 4/10/2017, 3:51:50 PM
Parent: 34376147b67c10d43f8b82ccd4b103cdca869d2b
Parent: 6142de4291409edc60c0927ff49549d8ba825589

Files changed

plugins/replicate.jschanged
plugins/replicate.jsView
@@ -59,19 +59,17 @@
5959 var pendingPeers = {}
6060 var legacyToRecv = {}
6161
6262 Object.keys(pendingFeedsForPeer).forEach(function (peerId) {
63- if (pendingFeedsForPeer[peerId]) {
63 + if (pendingFeedsForPeer[peerId] && pendingFeedsForPeer[peerId].size) {
6464 Object.keys(toSend).forEach(function (feedId) {
6565 if (peerHas[peerId] && peerHas[peerId][feedId]) {
6666 if (peerHas[peerId][feedId] > toSend[feedId]) {
6767 pendingFeeds.add(feedId)
6868 }
6969 }
7070 })
71- if (pendingFeedsForPeer[peerId].size) {
72- pendingPeers[peerId] = pendingFeedsForPeer[peerId].size
73- }
71 + pendingPeers[peerId] = pendingFeedsForPeer[peerId].size
7472 }
7573 })
7674
7775 for (var k in toSend) {
@@ -250,8 +248,10 @@
250248
251249 sbot.emit('replicate:start', rpc)
252250 rpc.on('closed', function () {
253251 sbot.emit('replicate:finish', toSend)
252 + delete pendingFeedsForPeer[rpc.id]
253 + debounce.set()
254254 })
255255 var errorsSeen = {}
256256 pull(
257257 upto({live: opts.live}),
@@ -287,9 +287,12 @@
287287 err.stack)
288288 }
289289 }
290290
291- pendingFeedsForPeer[rpc.id].delete(upto.id)
291 + if (pendingFeedsForPeer[rpc.id]) {
292 + pendingFeedsForPeer[rpc.id].delete(upto.id)
293 + }
294 +
292295 debounce.set()
293296 })
294297 )
295298

Built with git-ssb-web