Skip to content

Commit 1b0c122

Browse files
tenthirtyonetenthirtyone
tenthirtyone
authored and
tenthirtyone
committed
bcoin config updated for log levels and network
1 parent b8e8926 commit 1b0c122

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

lib/services/p2p/bcoin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ Bcoin.prototype.stop = function() {
3535
Bcoin.prototype._getConfig = function(options) {
3636
var config = {
3737
checkpoints: true,
38-
network: options.network || 'main',
39-
listen: true
38+
network: options.bcoin_network || 'main',
39+
listen: true,
40+
logLevel: options.logLevel
4041
};
4142
if (options.prefix) {
4243
config.prefix = options.prefix;

lib/services/p2p/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ P2P.prototype._connect = function() {
176176
};
177177

178178
P2P.prototype._getBestHeight = function() {
179+
179180
if (this._peers === 0) {
180181
return 0;
181182
}
@@ -285,7 +286,6 @@ P2P.prototype._onPeerReady = function(peer, addr) {
285286

286287
};
287288

288-
289289
P2P.prototype._onPeerTx = function(peer, message) {
290290
var filteredMessage = this._applyMempoolFilter(message);
291291
if (filteredMessage) {
@@ -332,9 +332,16 @@ P2P.prototype._setResourceFilter = function(filter, resource) {
332332
};
333333

334334
P2P.prototype._startBcoin = function() {
335+
var logLevel;
336+
if (process.env.BITCORE_ENV === 'debug') {
337+
log.info('Debug mode detected, starting Bcoin logger');
338+
logLevel = 'info';
339+
}
340+
335341
this._bcoin = new Bcoin({
336342
network: this.node.network,
337-
prefix: this.node.datadir
343+
prefix: this.node.datadir,
344+
logLevel: logLevel,
338345
});
339346
this._bcoin.start();
340347
};

0 commit comments

Comments
 (0)