Compare commits

..

2 Commits

Author SHA1 Message Date
fiatjaf
6e5441aa18 fix type assertions.
closes https://github.com/fiatjaf/nak/issues/67
2025-05-22 09:23:26 -03:00
fiatjaf
61a68f3dca fix faulty outbox database check logic when it doesn't exist.
fixes https://github.com/fiatjaf/nak/issues/66
2025-05-21 14:12:22 -03:00
4 changed files with 6 additions and 4 deletions

2
go.mod
View File

@@ -4,7 +4,7 @@ go 1.24.1
require (
fiatjaf.com/lib v0.3.1
fiatjaf.com/nostr v0.0.0-20250521022139-d3fb25441ab3
fiatjaf.com/nostr v0.0.0-20250522115245-f38ce069a93d
github.com/bep/debounce v1.2.1
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e

2
go.sum
View File

@@ -3,6 +3,8 @@ fiatjaf.com/lib v0.3.1 h1:/oFQwNtFRfV+ukmOCxfBEAuayoLwXp4wu2/fz5iHpwA=
fiatjaf.com/lib v0.3.1/go.mod h1:Ycqq3+mJ9jAWu7XjbQI1cVr+OFgnHn79dQR5oTII47g=
fiatjaf.com/nostr v0.0.0-20250521022139-d3fb25441ab3 h1:JRtme8g4UQ5KYlxI31wBa8YMWmAxvxdwtNn+PiI/XCs=
fiatjaf.com/nostr v0.0.0-20250521022139-d3fb25441ab3/go.mod h1:VPs38Fc8J1XAErV750CXAmMUqIq3XEX9VZVj/LuQzzM=
fiatjaf.com/nostr v0.0.0-20250522115245-f38ce069a93d h1:sl/BOXW5eK7v+cchMMEZvnzQW+n/jWiHGQn+CRt5m5Q=
fiatjaf.com/nostr v0.0.0-20250522115245-f38ce069a93d/go.mod h1:VPs38Fc8J1XAErV750CXAmMUqIq3XEX9VZVj/LuQzzM=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/FastFilter/xorfilter v0.2.1 h1:lbdeLG9BdpquK64ZsleBS8B4xO/QW1IM0gMzF7KaBKc=
github.com/FastFilter/xorfilter v0.2.1/go.mod h1:aumvdkhscz6YBZF9ZA/6O4fIoNod4YR50kIVGGZ7l9I=

View File

@@ -85,7 +85,7 @@ var app = &cli.Command{
sys = sdk.NewSystem()
if err := initializeOutboxHintsDB(c, sys); err != nil {
return ctx, fmt.Errorf("failed to initialized outbox hints: %w", err)
return ctx, fmt.Errorf("failed to initialize outbox hints: %w", err)
}
sys.Pool = nostr.NewPool(nostr.PoolOptions{

View File

@@ -29,9 +29,9 @@ func initializeOutboxHintsDB(c *cli.Command, sys *sdk.System) error {
hintsFilePath = filepath.Join(configPath, "outbox/hints.bg")
}
if hintsFilePath != "" {
if _, err := os.Stat(hintsFilePath); !os.IsNotExist(err) {
if _, err := os.Stat(hintsFilePath); err == nil {
hintsFileExists = true
} else if err != nil {
} else if !os.IsNotExist(err) {
return err
}
}