Minor bug fixes

This commit is contained in:
jdl
2026-06-14 05:30:59 +02:00
parent c45ac83eb0
commit 992eabc0e9
3 changed files with 3 additions and 3 deletions

View File

@@ -204,7 +204,7 @@ func (a *API) Peer_Init(peer *Peer, args m.PeerInitArgs) error {
// we held the lock, so it may be stale under concurrent requests.
current, err := db.Peer_Get(a.db, peer.NetworkID, peer.PeerIP)
if err != nil {
return err
return errs.DB(err)
}
if len(current.WGPubKey) != 0 {
return errs.ErrAlreadyExists

View File

@@ -17,7 +17,7 @@ func DB(err error) error {
return err
}
if err == sql.ErrNoRows {
if errors.Is(err, sql.ErrNoRows) {
return ErrNotFound
}

View File

@@ -29,7 +29,7 @@ type Peer struct {
EndpointLAN netip.AddrPort // Discovered via multicast.
RTT time.Duration // Round-trip time.
State PeerState // Current routing state; updated on each devXxx call.
Role control.Role // Client initiates pings; server responds.
Role control.Role // Role in relation to the local application.
SignPubKey [32]byte // nacl/sign public key for verifying multicast beacons.
}