bip150: display bip150 address to user.

This commit is contained in:
Christopher Jeffrey 2016-08-23 04:22:46 -07:00
parent 134bece292
commit 51975003c2
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 5 additions and 4 deletions

View File

@ -162,17 +162,17 @@ BIP150.prototype.propose = function propose(payload) {
BIP150.prototype.toChallenge = function toChallenge(writer) {
var p = new bcoin.writer(writer);
var msg;
var hash;
assert(this.outbound, 'Cannot challenge an inbound connection.');
assert(this.peerIdentity, 'Cannot challenge without a peer identity.');
msg = this.hash(this.output.sid, 'i', this.peerIdentity);
hash = this.hash(this.output.sid, 'i', this.peerIdentity);
assert(!this.challengeSent, 'Cannot initiate challenge twice.');
this.challengeSent = true;
p.writeBytes(msg);
p.writeBytes(hash);
if (!writer)
p = p.render();

View File

@ -350,7 +350,8 @@ Peer.prototype._onHandshake = function _onHandshake() {
assert(this.bip150.completed);
if (this.bip150.auth) {
this.logger.info('BIP150 handshake complete (%s).', this.hostname);
this.logger.info('Peer is authed (%s).', this.hostname);
this.logger.info('Peer is authed (%s): %s.',
this.hostname, this.bip150.getAddress());
}
}