diff --git a/lib/address.js b/lib/address.js index f3f2116..43369bd 100644 --- a/lib/address.js +++ b/lib/address.js @@ -1,7 +1,7 @@ 'use strict'; -var base58check = require('./base58check'); -var constants = require('./constants'); +var base58check = require('./protocol/base58check'); +var constants = require('./protocol/constants'); var Hash = require('./crypto/hash'); function Address(buf) { diff --git a/lib/block.js b/lib/block.js index 4798945..bf09b00 100644 --- a/lib/block.js +++ b/lib/block.js @@ -1,9 +1,11 @@ +'use strict'; + +var Hash = require('./crypto/hash'); +var BufferReader = require('./protocol/bufferreader'); +var BufferWriter = require('./protocol/bufferwriter'); +var Varint = require('./protocol/varint'); var Transaction = require('./transaction'); -var BufferReader = require('./bufferreader'); -var BufferWriter = require('./bufferwriter'); var Blockheader = require('./blockheader'); -var Varint = require('./varint'); -var Hash = require('./hash'); var Block = function Block(magicnum, blocksize, blockheader, txsvi, txs) { if (!(this instanceof Block)) diff --git a/lib/blockheader.js b/lib/blockheader.js index b24412e..81d7308 100644 --- a/lib/blockheader.js +++ b/lib/blockheader.js @@ -1,5 +1,7 @@ -var BufferReader = require('./bufferreader'); -var BufferWriter = require('./bufferwriter'); +'use strict'; + +var BufferReader = require('./protocol/bufferreader'); +var BufferWriter = require('./protocol/bufferwriter'); var Blockheader = function Blockheader(version, prevblockidbuf, merklerootbuf, time, bits, nonce) { if (!(this instanceof Blockheader)) @@ -20,7 +22,7 @@ var Blockheader = function Blockheader(version, prevblockidbuf, merklerootbuf, t var obj = version; this.set(obj); } -} +}; Blockheader.prototype.set = function(obj) { this.version = typeof obj.version !== 'undefined' ? obj.version : this.version; diff --git a/lib/keypair.js b/lib/keypair.js index 5d0da56..50b38bc 100644 --- a/lib/keypair.js +++ b/lib/keypair.js @@ -1,3 +1,5 @@ +'use strict'; + var Privkey = require('./privkey'); var Pubkey = require('./pubkey'); diff --git a/lib/opcode.js b/lib/opcode.js index c53bdc8..323c154 100644 --- a/lib/opcode.js +++ b/lib/opcode.js @@ -1,3 +1,5 @@ +'use strict'; + function Opcode(num) { if (!(this instanceof Opcode)) return new Opcode(num); diff --git a/lib/privkey.js b/lib/privkey.js index 9ee2508..a7ed870 100644 --- a/lib/privkey.js +++ b/lib/privkey.js @@ -2,9 +2,9 @@ var BN = require('./crypto/bn'); var Point = require('./crypto/point'); +var Random = require('./crypto/random'); var constants = require('./protocol/constants'); var base58check = require('./protocol/base58check'); -var Random = require('./crypto/random'); var Privkey = function Privkey(bn) { if (!(this instanceof Privkey)) diff --git a/lib/pubkey.js b/lib/pubkey.js index 0e32207..d9062a4 100644 --- a/lib/pubkey.js +++ b/lib/pubkey.js @@ -1,6 +1,7 @@ +'use strict'; + var Point = require('./crypto/point'); var bn = require('./crypto/bn'); -var privkey = require('./privkey'); var Pubkey = function Pubkey(point) { if (!(this instanceof Pubkey)) diff --git a/lib/script.js b/lib/script.js index 149946c..377c41a 100644 --- a/lib/script.js +++ b/lib/script.js @@ -1,5 +1,7 @@ -var BufferReader = require('./bufferreader'); -var BufferWriter = require('./bufferwriter'); +'use strict'; + +var BufferReader = require('./protocol/bufferreader'); +var BufferWriter = require('./protocol/bufferwriter'); var Opcode = require('./opcode'); var Script = function Script(buf) {