Skip to content

Commit

Permalink
add note to HostsForScanning that not all result fields are populated
Browse files Browse the repository at this point in the history
  • Loading branch information
chris124567 committed Nov 14, 2024
1 parent 3b1061f commit ae19081
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions persist/sqlite/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ func (st *Store) Hosts(pks []types.PublicKey) (result []explorer.Host, err error
}

// HostsForScanning returns hosts ordered by the transaction they were created in.
// Note that only the PublicKey, NetAddress, and V2NetAddresses fields are
// populated.
func (s *Store) HostsForScanning(maxLastScan, minLastAnnouncement time.Time, offset, limit uint64) (result []explorer.Host, err error) {
err = s.transaction(func(tx *txn) error {
rows, err := tx.Query(`SELECT public_key, net_address FROM host_info WHERE last_scan <= ? AND last_announcement >= ? ORDER BY last_scan ASC LIMIT ? OFFSET ?`, encode(maxLastScan), encode(minLastAnnouncement), limit, offset)
Expand Down

0 comments on commit ae19081

Please sign in to comment.