From 395c43ad74c582606409dd14df0cc6d3e5cfbe1e Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 11 Aug 2015 17:03:46 +1000 Subject: [PATCH] block: remove use of assert --- src/block.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/block.js b/src/block.js index 5d4dc1a..8a36f65 100644 --- a/src/block.js +++ b/src/block.js @@ -1,4 +1,3 @@ -var assert = require('assert') var bufferutils = require('./bufferutils') var crypto = require('./crypto') @@ -14,7 +13,7 @@ function Block () { } Block.fromBuffer = function (buffer) { - assert(buffer.length >= 80, 'Buffer too small (< 80 bytes)') + if (buffer.length < 80) throw new Error('Buffer too small (< 80 bytes)') var offset = 0 function readSlice (n) {