2024-09-10 22:37:48 -03:00
|
|
|
package hints
|
|
|
|
|
|
|
|
import "github.com/nbd-wtf/go-nostr"
|
|
|
|
|
|
|
|
const END_OF_WORLD nostr.Timestamp = 2208999600 // 2040-01-01
|
|
|
|
|
|
|
|
type HintKey int
|
|
|
|
|
|
|
|
const (
|
|
|
|
LastFetchAttempt HintKey = iota
|
|
|
|
MostRecentEventFetched
|
|
|
|
LastInRelayList
|
2025-01-18 18:19:54 -03:00
|
|
|
LastInHint
|
2024-09-10 22:37:48 -03:00
|
|
|
)
|
|
|
|
|
2025-01-18 18:19:54 -03:00
|
|
|
var KeyBasePoints = [4]int64{
|
2024-09-10 22:37:48 -03:00
|
|
|
-500, // attempting has negative power because it may fail
|
|
|
|
700, // when it succeeds that should cancel the negative effect of trying
|
|
|
|
350, // a relay list is a very strong indicator
|
2025-01-18 18:19:54 -03:00
|
|
|
20, // hints from various sources (tags, nprofile, nevent, nip05)
|
2024-09-10 22:37:48 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (hk HintKey) BasePoints() int64 { return KeyBasePoints[hk] }
|
|
|
|
|
|
|
|
func (hk HintKey) String() string {
|
|
|
|
switch hk {
|
|
|
|
case LastFetchAttempt:
|
|
|
|
return "last_fetch_attempt"
|
|
|
|
case MostRecentEventFetched:
|
|
|
|
return "most_recent_event_fetched"
|
|
|
|
case LastInRelayList:
|
|
|
|
return "last_in_relay_list"
|
2025-01-18 18:19:54 -03:00
|
|
|
case LastInHint:
|
|
|
|
return "last_in_hint"
|
2024-09-10 22:37:48 -03:00
|
|
|
}
|
|
|
|
return "<unexpected>"
|
|
|
|
}
|