body is actually defined in the function

This commit is contained in:
Ryan X. Charles 2014-09-19 17:41:22 -07:00
parent cc3196085f
commit d57613bc91

View File

@ -7,7 +7,6 @@ var BufferWriter = require('../lib/bufferwriter');
//cat blk00000.dat | node blockreader.js //cat blk00000.dat | node blockreader.js
var head = null; var head = null;
var body = null;
process.stdin.on('readable', function() { process.stdin.on('readable', function() {
if (!head) { if (!head) {
@ -22,6 +21,5 @@ process.stdin.on('readable', function() {
var block = Block().fromBuffer(blockbuf); var block = Block().fromBuffer(blockbuf);
console.log(block.toJSON()); console.log(block.toJSON());
head = null; head = null;
body = null;
process.stdin.unshift(process.stdin.read()); process.stdin.unshift(process.stdin.read());
}); });