fcoin/lib/bcoin/node.js
Christopher Jeffrey c445fcd1bd more linting.
2016-03-15 04:59:39 -07:00

53 lines
955 B
JavaScript

/**
* node.js - node object for bcoin
* Copyright (c) 2014-2015, Fedor Indutny (MIT License)
* https://github.com/indutny/bcoin
*/
var EventEmitter = require('events').EventEmitter;
var bcoin = require('../bcoin');
var network = bcoin.protocol.network;
var utils = require('./utils');
/**
* Node
*/
function Node(options) {
if (!(this instanceof Node))
return new Node(options);
EventEmitter.call(this);
if (!options)
options = {};
this.options = options;
if (this.options.debug != null)
bcoin.debugLogs = this.options.debug;
if (this.options.debugFile != null)
bcoin.debugFile = this.options.debugFile;
if (this.options.network)
network.set(this.options.network);
this.network = network;
this.mempool = null;
this.pool = null;
this.chain = null;
this.miner = null;
this.walletdb = null;
Node.global = this;
}
utils.inherits(Node, EventEmitter);
/**
* Expose
*/
module.exports = Node;