[lightning] unique sockets for ln nodes
This commit is contained in:
parent
5b19ffd524
commit
ddfceddc57
@ -713,7 +713,9 @@ class NodesApi {
|
|||||||
* Update node sockets
|
* Update node sockets
|
||||||
*/
|
*/
|
||||||
public async $updateNodeSockets(publicKey: string, sockets: {network: string; addr: string}[]): Promise<void> {
|
public async $updateNodeSockets(publicKey: string, sockets: {network: string; addr: string}[]): Promise<void> {
|
||||||
const formattedSockets = (sockets.map(a => a.addr).join(',')) ?? '';
|
const uniqueAddr = [...new Set(sockets.map(a => a.addr))];
|
||||||
|
|
||||||
|
const formattedSockets = (uniqueAddr.join(',')) ?? '';
|
||||||
try {
|
try {
|
||||||
await DB.query(`UPDATE nodes SET sockets = ? WHERE public_key = ?`, [formattedSockets, publicKey]);
|
await DB.query(`UPDATE nodes SET sockets = ? WHERE public_key = ?`, [formattedSockets, publicKey]);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user