-
Notifications
You must be signed in to change notification settings - Fork 637
Embedded bcoin node stability improvements #516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded bcoin node stability improvements #516
Conversation
nitsujlangston
commented
Aug 9, 2017
- making embedded bcoin sync persistent
- correctly shutdown embedded bcoin instance
- wait until bcoin is listening on P2P before trying to connect
- align bcoin port and peer port
* correctly shutdown embedded bcoin instance * wait until bcoin is listening on P2P before trying to connect * align bcoin port and peer port
@nitsujlangston Sec, got through it |
simpler connect handling
self._initCache(); | ||
self._initPool(); | ||
self._setListeners(); | ||
callback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startBcoinIfNec...
I think the callback on 116 here may be unnecessary. Any function passed through will executed after Bcoin finishes syncing and 'full' is fired. But the cb does not take any parameters. I can see:
() => { console.log('finished') }
;
working here. But what were your thoughts?
That said, this is benign and I am unable to tell what is going on in the scaffolding that could be passing a CB here or what its significance would be
@@ -126,6 +125,9 @@ P2P.prototype._disconnectPool = function() { | |||
}; | |||
|
|||
P2P.prototype.stop = function(callback) { | |||
if (this._bcoin){ | |||
return this._bcoin.stop(callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bcoin.stop does not accept any parameters.
lib/services/p2p/index.js
Outdated
log.info('Connecting to p2p network.'); | ||
this._pool.connect(); | ||
self._pool.connect(); | ||
var retryInterval = setInterval(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to drop this polling if self._pool.connect() were added to the Bcoin start callback?
…BcoinStartupHandling
…BcoinStartupHandling