src/protocol/network.js
function Network(options) {
  if (!(this instanceof Network))
    return new Network(options);

  assert(!Network[options.type], 'Cannot create two networks.');

  this.type = options.type;
  this.seeds = options.seeds;
  this.magic = options.magic;
  this.port = options.port;
  this.checkpointMap = options.checkpointMap;
  this.lastCheckpoint = options.lastCheckpoint;
  this.checkpoints = [];
  this.halvingInterval = options.halvingInterval;
  this.genesis = options.genesis;
  this.genesisBlock = options.genesisBlock;
  this.pow = options.pow;
  this.block = options.block;
  this.bip30 = options.bip30;
  this.activationThreshold = options.activationThreshold;
  this.minerWindow = options.minerWindow;
  this.deployments = options.deployments;
  this.deploys = options.deploys;
  this.unknownBits = ~consensus.VERSION_TOP_MASK;
  this.keyPrefix = options.keyPrefix;
  this.addressPrefix = options.addressPrefix;
  this.requireStandard = options.requireStandard;
  this.rpcPort = options.rpcPort;
  this.minRelay = options.minRelay;
  this.feeRate = options.feeRate;
  this.maxFeeRate = options.maxFeeRate;
  this.selfConnect = options.selfConnect;
  this.requestMempool = options.requestMempool;
  this.time = new TimeData();

  this._init();
}
function Network(options) {
  if (!(this instanceof Network))
    return new Network(options);

  assert(!Network[options.type], 'Cannot create two networks.');

  this.type = options.type;
  this.seeds = options.seeds;
  this.magic = options.magic;
  this.port = options.port;
  this.checkpointMap = options.checkpointMap;
  this.lastCheckpoint = options.lastCheckpoint;
  this.checkpoints = [];
  this.halvingInterval = options.halvingInterval;
  this.genesis = options.genesis;
  this.genesisBlock = options.genesisBlock;
  this.pow = options.pow;
  this.block = options.block;
  this.bip30 = options.bip30;
  this.activationThreshold = options.activationThreshold;
  this.minerWindow = options.minerWindow;
  this.deployments = options.deployments;
  this.deploys = options.deploys;
  this.unknownBits = ~consensus.VERSION_TOP_MASK;
  this.keyPrefix = options.keyPrefix;
  this.addressPrefix = options.addressPrefix;
  this.requireStandard = options.requireStandard;
  this.rpcPort = options.rpcPort;
  this.minRelay = options.minRelay;
  this.feeRate = options.feeRate;
  this.maxFeeRate = options.maxFeeRate;
  this.selfConnect = options.selfConnect;
  this.requestMempool = options.requestMempool;
  this.time = new TimeData();

  this._init();
}
function Network ( options ) { if ( ! ( this instanceof Network ) ) return new Network ( options ) ; assert ( ! Network [ options . type ] , 'Cannot create two networks.' ) ; this . type = options . type ; this . seeds = options . seeds ; this . magic = options . magic ; this . port = options . port ; this . checkpointMap = options . checkpointMap ; this . lastCheckpoint = options . lastCheckpoint ; this . checkpoints = [ ] ; this . halvingInterval = options . halvingInterval ; this . genesis = options . genesis ; this . genesisBlock = options . genesisBlock ; this . pow = options . pow ; this . block = options . block ; this . bip30 = options . bip30 ; this . activationThreshold = options . activationThreshold ; this . minerWindow = options . minerWindow ; this . deployments = options . deployments ; this . deploys = options . deploys ; this . unknownBits = ~ consensus . VERSION_TOP_MASK ; this . keyPrefix = options . keyPrefix ; this . addressPrefix = options . addressPrefix ; this . requireStandard = options . requireStandard ; this . rpcPort = options . rpcPort ; this . minRelay = options . minRelay ; this . feeRate = options . feeRate ; this . maxFeeRate = options . maxFeeRate ; this . selfConnect = options . selfConnect ; this . requestMempool = options . requestMempool ; this . time = new TimeData ( ) ; this . _init ( ) ; }
Represents a network.
@alias module:protocol.Network
@constructor
@param {Object|NetworkType} options - See {@link module:network}.
Represents a network .