[fix] expectedPubkey

This commit is contained in:
2019-06-11 13:28:41 +02:00
parent 5544d56ebb
commit 774cdb1daf
2 changed files with 7 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ export interface Conf {
export interface ConfWS2P { export interface ConfWS2P {
address: string address: string
expectedKey: string expectedPubkey: string
salt: string salt: string
passwd: string passwd: string
currency: string currency: string

View File

@@ -32,7 +32,7 @@ export function ws2pWatcher(conf: Conf) {
connectionTimeout: conf.connectionTimeout, connectionTimeout: conf.connectionTimeout,
requestTimeout: 0 // No request anyway requestTimeout: 0 // No request anyway
}, },
wserver.expectedKey wserver.expectedPubkey
) )
await c.connectAsInitiator() await c.connectAsInitiator()
@@ -42,20 +42,18 @@ export function ws2pWatcher(conf: Conf) {
conf.reconnectionDelays, conf.reconnectionDelays,
mail.onEstablished(conf, wserver.expectedKey), mail.onEstablished(conf, wserver.expectedPubkey),
// When a disconnection is detected // When a disconnection is detected
mail.onDisconnect(conf, wserver.expectedKey), mail.onDisconnect(conf, wserver.expectedPubkey),
async () => { async () => {
console.log('Trying to connect to %s', wserver.expectedKey) console.log('Trying to connect to %s', wserver.expectedPubkey)
}, },
mail.onRestartSuccess(conf, wserver.expectedKey), mail.onRestartSuccess(conf, wserver.expectedPubkey),
async (e) => { mail.onError(conf, wserver.expectedPubkey)
console.error(e)
}
) )
} }