use proper shse.pubkey

This commit is contained in:
Andre Staltz 2023-08-10 10:55:18 +03:00
parent 62ad921abb
commit d2dd75de0f
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
2 changed files with 2 additions and 4 deletions

View File

@ -165,7 +165,7 @@ module.exports = class HubObserver {
*/ */
#notifyNewAttendant(attendantPubkey, hubPubkey, hubName) { #notifyNewAttendant(attendantPubkey, hubPubkey, hubName) {
if (attendantPubkey === hubPubkey) return if (attendantPubkey === hubPubkey) return
if (attendantPubkey === this.#sstack.id) return if (attendantPubkey === this.#local.shse.pubkey) return
const address = this.#getAddress(attendantPubkey) const address = this.#getAddress(attendantPubkey)
this.#local.hubClient._notifyDiscoveredAttendant({ this.#local.hubClient._notifyDiscoveredAttendant({
address, address,

View File

@ -1,7 +1,6 @@
// @ts-ignore // @ts-ignore
const DuplexPair = require('pull-pair/duplex') // @ts-ignore const DuplexPair = require('pull-pair/duplex') // @ts-ignore
const Notify = require('pull-notify') const Notify = require('pull-notify')
const bs58 = require('bs58')
const debug = require('debug')('ppppp:hub-client') const debug = require('debug')('ppppp:hub-client')
const makeTunnelPlugin = require('./ms-tunnel') const makeTunnelPlugin = require('./ms-tunnel')
const { ErrorDuplex } = require('./utils') const { ErrorDuplex } = require('./utils')
@ -52,8 +51,7 @@ module.exports = {
*/ */
connect(origin) { connect(origin) {
// @ts-ignore // @ts-ignore
// FIXME: this comes from secret-stack const hub = this.shse.pubkey
const hub = bs58.encode(Buffer.from(this.id, 'base64'))
debug('received hubClient.connect(%s) via hub %s', origin, hub) debug('received hubClient.connect(%s) via hub %s', origin, hub)
if (hubs.has(hub) && origin) { if (hubs.has(hub) && origin) {
debug('connect() will resolve because handler exists') debug('connect() will resolve because handler exists')