12 Commits

Author SHA1 Message Date
fiatjaf
1f1d3cfe7f some changes and fixes related to sub.Sub(). 2022-05-04 12:39:10 -03:00
fiatjaf
5d1a29d135 stop closing publishstatus connection and subscriptions.
I'm not sure about this but it seems to work better this way.
2022-05-01 21:11:46 -03:00
fiatjaf
16c874cb8d add String() method to Status int on PublishStatus. 2022-05-01 17:51:46 -03:00
fiatjaf
a11aa8756b fix CheckSignature(): we were parsing the pubkey with the ECDSA function instead of Schnorr. 2022-05-01 17:51:16 -03:00
fiatjaf
00ad1acde9 use schnorr from btcec instead of the bip340 library. 2022-05-01 15:10:18 -03:00
Gustavo Chain
c0a2be91a1 relaypool: continue on ping msg 2022-02-19 08:33:29 -03:00
fiatjaf
86853004ef change parsing so NIP12 can work, rename types. 2022-02-08 16:27:33 -03:00
fiatjaf
ef1f548212 avoid sending to closed Events/UniqueEvents channels. 2022-02-07 11:33:45 -03:00
Honza Pokorny
a3df2cb893 Add mutexes around websockets
We replace the bare websocket.Conn type with a new Connection type which
implements `WriteJSON`, `WriteMessage`, and `Close`.  The Connection
type adds mutexes around writes since gorilla doesn't support concurrent
writes to websockets.

Signed-off-by: Honza Pokorny <honza@pokorny.ca>
2022-01-12 12:19:33 -03:00
Honza Pokorny
26c3b4aac9 Remove unnecessary argument to subscription.Sub
The `Sub()` function retrieves the list of filters from the
`Subscripton` object itself, and therefore it's unnecessary to pass it
in.  The argument is unused.

Here, we remove the function argument from the definition, and from the
single call site.  We then pass the filters to the initializer.

This makes it so that filters are in fact passed to the relay on the wire.
2022-01-04 12:24:05 -03:00
fiatjaf
140edc693c relay policies as interfaces, SimplePolicy as the most basic implementation. 2022-01-02 08:50:53 -03:00
fiatjaf
d131e8460e move everything to the same directory. 2022-01-02 08:44:18 -03:00