Skip to content

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

Merged
merged 8 commits into from
Aug 9, 2017

Conversation

nitsujlangston
Copy link
Member

  • 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
@tenthirtyone
Copy link
Contributor

tenthirtyone commented Aug 9, 2017

@nitsujlangston Sec, got through it

@tenthirtyone tenthirtyone self-assigned this Aug 9, 2017
simpler connect handling
self._initCache();
self._initPool();
self._setListeners();
callback();
Copy link
Contributor

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);
Copy link
Contributor

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.

log.info('Connecting to p2p network.');
this._pool.connect();
self._pool.connect();
var retryInterval = setInterval(function() {
Copy link
Contributor

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?

@kleetus kleetus merged commit 93a78ca into bitpay:blocks Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants