|
@ -47,13 +47,13 @@ export function connectAndOpen(lnd, meta, event, payload) { |
|
|
call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data })) |
|
|
call.on('data', data => event.sender.send('pushchannelupdated', { pubkey, data })) |
|
|
call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() })) |
|
|
call.on('error', error => event.sender.send('pushchannelerror', { pubkey, error: error.toString() })) |
|
|
}) |
|
|
}) |
|
|
.catch(err => { |
|
|
.catch((err) => { |
|
|
console.log('connect peer err: ', err) |
|
|
console.log('connect peer err: ', err) |
|
|
event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) |
|
|
event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(err => { |
|
|
.catch((err) => { |
|
|
console.log('list peer err: ', err) |
|
|
console.log('list peer err: ', err) |
|
|
event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) |
|
|
event.sender.send('pushchannelerror', { pubkey, error: err.toString() }) |
|
|
}) |
|
|
}) |
|
@ -79,8 +79,7 @@ export function openChannel(lnd, meta, event, payload) { |
|
|
return new Promise((resolve, reject) => |
|
|
return new Promise((resolve, reject) => |
|
|
pushopenchannel(lnd, meta, event, res) |
|
|
pushopenchannel(lnd, meta, event, res) |
|
|
.then(data => resolve(data)) |
|
|
.then(data => resolve(data)) |
|
|
.catch(error => reject(error)) |
|
|
.catch(error => reject(error))) |
|
|
) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|