mirror of
https://github.com/mempool/mempool.git
synced 2025-04-08 11:58:31 +02:00
[lightning] unique sockets for ln nodes
This commit is contained in:
parent
5b19ffd524
commit
ddfceddc57
@ -713,7 +713,9 @@ class NodesApi {
|
||||
* Update node sockets
|
||||
*/
|
||||
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 {
|
||||
await DB.query(`UPDATE nodes SET sockets = ? WHERE public_key = ?`, [formattedSockets, publicKey]);
|
||||
} catch (e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user