fix stale relays bug
Also, attempts to send updated relays to all online relays using Blastr. If that fails, it falls back to broadcasting to 20 random online relays.
This commit is contained in:
@ -116,6 +116,15 @@ export default function useEventPublisher() {
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Write to every online relay using Blastr.
|
||||
* https://github.com/MutinyWallet/blastr
|
||||
*/
|
||||
broadcastWithBlastr: (ev: NEvent | undefined) => {
|
||||
if (ev) {
|
||||
System.WriteOnceToRelay("wss://nostr.mutinywallet.com", ev);
|
||||
}
|
||||
},
|
||||
muted: async (keys: HexKey[], priv: HexKey[]) => {
|
||||
if (pubKey) {
|
||||
const ev = NEvent.ForPubKey(pubKey);
|
||||
@ -251,18 +260,6 @@ export default function useEventPublisher() {
|
||||
return await signEvent(ev);
|
||||
}
|
||||
},
|
||||
saveRelays: async () => {
|
||||
if (pubKey) {
|
||||
const ev = NEvent.ForPubKey(pubKey);
|
||||
ev.Kind = EventKind.ContactList;
|
||||
ev.Content = JSON.stringify(relays);
|
||||
for (const pk of follows) {
|
||||
ev.Tags.push(new Tag(["p", pk], ev.Tags.length));
|
||||
}
|
||||
|
||||
return await signEvent(ev);
|
||||
}
|
||||
},
|
||||
saveRelaysSettings: async () => {
|
||||
if (pubKey) {
|
||||
const ev = NEvent.ForPubKey(pubKey);
|
||||
|
Reference in New Issue
Block a user