function reallyReady (archive, cb) {
  if (archive.metadata.peers.length) {
    archive.metadata.update({ ifAvailable: true }, cb)
  } else {
    archive.metadata.once('peer-add', () => {
      archive.metadata.update({ ifAvailable: true }, cb)
    })
  }
}
// This make sure you sync up with peers before trying to do anything with the archive
This make sure you sync up with peers before trying to do anything with the archive
This make sure you sync up with peers before trying to do anything with the archive
function reallyReady (archive, cb) {
  if (archive.metadata.peers.length) {
    archive.metadata.update({ ifAvailable: true }, cb)
  } else {
    archive.metadata.once('peer-add', () => {
      archive.metadata.update({ ifAvailable: true }, cb)
    })
  }
}
function reallyReady ( archive , cb ) { if ( archive . metadata . peers . length ) { archive . metadata . update ( { ifAvailable : true } , cb ) } else { archive . metadata . once ( 'peer-add' , ( ) => { archive . metadata . update ( { ifAvailable : true } , cb ) } ) } }
This make sure you sync up with peers before trying to do anything with the archive
This make sure you sync up with peers before trying to do anything with the archive