Minor bug fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -17,7 +17,7 @@ func DB(err error) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err == sql.ErrNoRows {
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return ErrNotFound
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user