Browse Source

use strict to protocol

patch-2
Manuel Araoz 10 years ago
parent
commit
ca9b8d8f7b
  1. 4
      lib/address.js
  2. 10
      lib/block.js
  3. 8
      lib/blockheader.js
  4. 2
      lib/keypair.js
  5. 2
      lib/opcode.js
  6. 2
      lib/privkey.js
  7. 3
      lib/pubkey.js
  8. 6
      lib/script.js

4
lib/address.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var base58check = require('./base58check'); var base58check = require('./protocol/base58check');
var constants = require('./constants'); var constants = require('./protocol/constants');
var Hash = require('./crypto/hash'); var Hash = require('./crypto/hash');
function Address(buf) { function Address(buf) {

10
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 Transaction = require('./transaction');
var BufferReader = require('./bufferreader');
var BufferWriter = require('./bufferwriter');
var Blockheader = require('./blockheader'); var Blockheader = require('./blockheader');
var Varint = require('./varint');
var Hash = require('./hash');
var Block = function Block(magicnum, blocksize, blockheader, txsvi, txs) { var Block = function Block(magicnum, blocksize, blockheader, txsvi, txs) {
if (!(this instanceof Block)) if (!(this instanceof Block))

8
lib/blockheader.js

@ -1,5 +1,7 @@
var BufferReader = require('./bufferreader'); 'use strict';
var BufferWriter = require('./bufferwriter');
var BufferReader = require('./protocol/bufferreader');
var BufferWriter = require('./protocol/bufferwriter');
var Blockheader = function Blockheader(version, prevblockidbuf, merklerootbuf, time, bits, nonce) { var Blockheader = function Blockheader(version, prevblockidbuf, merklerootbuf, time, bits, nonce) {
if (!(this instanceof Blockheader)) if (!(this instanceof Blockheader))
@ -20,7 +22,7 @@ var Blockheader = function Blockheader(version, prevblockidbuf, merklerootbuf, t
var obj = version; var obj = version;
this.set(obj); this.set(obj);
} }
} };
Blockheader.prototype.set = function(obj) { Blockheader.prototype.set = function(obj) {
this.version = typeof obj.version !== 'undefined' ? obj.version : this.version; this.version = typeof obj.version !== 'undefined' ? obj.version : this.version;

2
lib/keypair.js

@ -1,3 +1,5 @@
'use strict';
var Privkey = require('./privkey'); var Privkey = require('./privkey');
var Pubkey = require('./pubkey'); var Pubkey = require('./pubkey');

2
lib/opcode.js

@ -1,3 +1,5 @@
'use strict';
function Opcode(num) { function Opcode(num) {
if (!(this instanceof Opcode)) if (!(this instanceof Opcode))
return new Opcode(num); return new Opcode(num);

2
lib/privkey.js

@ -2,9 +2,9 @@
var BN = require('./crypto/bn'); var BN = require('./crypto/bn');
var Point = require('./crypto/point'); var Point = require('./crypto/point');
var Random = require('./crypto/random');
var constants = require('./protocol/constants'); var constants = require('./protocol/constants');
var base58check = require('./protocol/base58check'); var base58check = require('./protocol/base58check');
var Random = require('./crypto/random');
var Privkey = function Privkey(bn) { var Privkey = function Privkey(bn) {
if (!(this instanceof Privkey)) if (!(this instanceof Privkey))

3
lib/pubkey.js

@ -1,6 +1,7 @@
'use strict';
var Point = require('./crypto/point'); var Point = require('./crypto/point');
var bn = require('./crypto/bn'); var bn = require('./crypto/bn');
var privkey = require('./privkey');
var Pubkey = function Pubkey(point) { var Pubkey = function Pubkey(point) {
if (!(this instanceof Pubkey)) if (!(this instanceof Pubkey))

6
lib/script.js

@ -1,5 +1,7 @@
var BufferReader = require('./bufferreader'); 'use strict';
var BufferWriter = require('./bufferwriter');
var BufferReader = require('./protocol/bufferreader');
var BufferWriter = require('./protocol/bufferwriter');
var Opcode = require('./opcode'); var Opcode = require('./opcode');
var Script = function Script(buf) { var Script = function Script(buf) {

Loading…
Cancel
Save