lib/replicate.js
function (log, seq, cb) {
    dag.logs.get(log, seq, function (err, entry) {
      if (err && err.notFound) return cb()
      if (err) return cb(err)
      if (entry.change > changes) return cb() // ensure snapshot

      entry.log = log
      entry.seq = seq

      var i = 0
      var loop = function () {
        if (i < entry.links.length) return sendHave(entry.links[i++], loop)
        entry.links = noarr // premature opt: less mem yo
        outgoing.push(entry, cb)
      }

      loop()
    })
  }
function (log, seq, cb) {
    dag.logs.get(log, seq, function (err, entry) {
      if (err && err.notFound) return cb()
      if (err) return cb(err)
      if (entry.change > changes) return cb() // ensure snapshot

      entry.log = log
      entry.seq = seq

      var i = 0
      var loop = function () {
        if (i < entry.links.length) return sendHave(entry.links[i++], loop)
        entry.links = noarr // premature opt: less mem yo
        outgoing.push(entry, cb)
      }

      loop()
    })
  }
function ( log , seq , cb ) { dag . logs . get ( log , seq , function ( err , entry ) { if ( err && err . notFound ) return cb ( ) if ( err ) return cb ( err ) if ( entry . change > changes ) return cb ( ) // ensure snapshot entry . log = log entry . seq = seq var i = 0 var loop = function ( ) { if ( i < entry . links . length ) return sendHave ( entry . links [ i ++ ] , loop ) entry . links = noarr // premature opt: less mem yo outgoing . push ( entry , cb ) } loop ( ) } ) }
Send a specific entry in a specific log to the other side. If the node links to other nodes, inform the other side we have those, too.
Send a specific entry in a specific log to the other side . If the node links to other nodes inform the other side we have those too .