inject.js
function hasLegacy (hashes) {
      var ary = Object.keys(hashes).filter(function (k) {
        return hashes[k] < 0
      })
      if(ary.length)
        peer.blobs.has(ary, function (err, haves) {
          if(err) drain.abort(err) //ERROR: abort this stream.
          else haves.forEach(function (have, i) {
            if(have) has(peer.id, ary[i], have)
          })
        })
    }
function hasLegacy (hashes) {
      var ary = Object.keys(hashes).filter(function (k) {
        return hashes[k] < 0
      })
      if(ary.length)
        peer.blobs.has(ary, function (err, haves) {
          if(err) drain.abort(err) //ERROR: abort this stream.
          else haves.forEach(function (have, i) {
            if(have) has(peer.id, ary[i], have)
          })
        })
    }
function hasLegacy ( hashes ) { var ary = Object . keys ( hashes ) . filter ( function ( k ) { return hashes [ k ] < 0 } ) if ( ary . length ) peer . blobs . has ( ary , function ( err , haves ) { if ( err ) drain . abort ( err ) //ERROR: abort this stream. else haves . forEach ( function ( have , i ) { if ( have ) has ( peer . id , ary [ i ] , have ) } ) } ) }
so we can abort it when we get an error.
so we can abort it when we get an error .