File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ Bcoin.prototype.start = function() {
2020 self . _bcoin . connect ( ) . then ( function ( ) {
2121 self . emitter . emit ( 'connect' ) ;
2222 self . _bcoin . startSync ( ) ;
23+ self . _bcoin . chain . on ( 'block' , function ( ) {
24+ console . log ( 'block' ) ;
25+ } )
2326 } ) ;
2427 } ) ;
2528} ;
@@ -35,8 +38,9 @@ Bcoin.prototype.stop = function() {
3538Bcoin . prototype . _getConfig = function ( options ) {
3639 var config = {
3740 checkpoints : true ,
38- network : options . network || 'main' ,
39- listen : true
41+ network : options . bcoin_network || 'main' ,
42+ listen : true ,
43+ logLevel : options . logLevel
4044 } ;
4145 if ( options . prefix ) {
4246 config . prefix = options . prefix ;
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ P2P.prototype._connect = function() {
176176} ;
177177
178178P2P . prototype . _getBestHeight = function ( ) {
179+
179180 if ( this . _peers === 0 ) {
180181 return 0 ;
181182 }
@@ -186,7 +187,7 @@ P2P.prototype._getBestHeight = function() {
186187 maxHeight = this . _peers [ i ] . bestHeight ;
187188 this . _peer = this . _peers [ i ] ;
188189 }
189- }
190+ } options . bcoin_network
190191 return maxHeight ;
191192} ;
192193
@@ -285,7 +286,6 @@ P2P.prototype._onPeerReady = function(peer, addr) {
285286
286287} ;
287288
288-
289289P2P . 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
334334P2P . 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} ;
You can’t perform that action at this time.
0 commit comments