From 4d8618e7035fb1b15c4b5bd0b281dbf38d67c974 Mon Sep 17 00:00:00 2001 From: Aaron Vasquez Date: Wed, 8 Aug 2018 14:20:58 -0400 Subject: [PATCH] Better handling of meta chunk --- src/streams/uploadStream.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/streams/uploadStream.js b/src/streams/uploadStream.js index 189a398..27b6f48 100644 --- a/src/streams/uploadStream.js +++ b/src/streams/uploadStream.js @@ -27,7 +27,6 @@ export default class UploadStream extends Writable { super(opts); this.options = opts; - this.metachunk = metachunk; this.genesisHash = genesisHash; this.numChunks = numChunks; this.alpha = alpha; @@ -35,7 +34,7 @@ export default class UploadStream extends Writable { this.sessIdA = sessIdA; this.sessIdB = sessIdB; this.chunkBufferLow = [metachunk]; - this.chunkBufferHigh = []; + this.chunkBufferHigh = [metachunk]; this.batchBuffer = []; this.ongoingUploads = 0; this.chunksProcessed = 0; @@ -78,9 +77,6 @@ export default class UploadStream extends Writable { _final(callback) { this.finishCallback = callback; - // Appends metachunk to beta. - this.chunkBufferHigh.push(this.metachunk); - if (this.chunkBufferLow.length > 0) { this.batchBuffer.push({ chunks: this.chunkBufferLow,