Skip to content

Commit 0dc10ba

Browse files
committed
accessman+lnd: rename checkIncomingConnBanScore for clarity
1 parent 869e541 commit 0dc10ba

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

accessman.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,15 @@ func (a *accessMan) newOpenChan(remotePub *btcec.PublicKey) error {
481481
}
482482
}
483483

484-
// checkIncomingConnBanScore checks whether, given the remote's public hex-
484+
// checkAcceptIncomingConn checks whether, given the remote's public hex-
485485
// encoded key, we should not accept this incoming connection or immediately
486486
// disconnect. This does not assign to the server's peerScores maps. This is
487487
// just an inbound filter that the brontide listeners use.
488488
//
489-
// TODO(yy): We should also consider removing this `checkIncomingConnBanScore`
489+
// TODO(yy): We should also consider removing this `checkAcceptIncomingConn`
490490
// check as a) it doesn't check for ban score; and b) we should, and already
491491
// have this check when we handle incoming connection in `InboundPeerConnected`.
492-
func (a *accessMan) checkIncomingConnBanScore(remotePub *btcec.PublicKey) (
492+
func (a *accessMan) checkAcceptIncomingConn(remotePub *btcec.PublicKey) (
493493
bool, error) {
494494

495495
ctx := btclog.WithCtx(

accessman_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func assertInboundConnection(t *testing.T, a *accessMan,
1616

1717
remotePubSer := string(remotePub.SerializeCompressed())
1818

19-
isSlotAvailable, err := a.checkIncomingConnBanScore(remotePub)
19+
isSlotAvailable, err := a.checkAcceptIncomingConn(remotePub)
2020
require.NoError(t, err)
2121
require.True(t, isSlotAvailable)
2222

@@ -128,7 +128,7 @@ func TestAccessManRestrictedSlots(t *testing.T) {
128128
peerKey4 := peerPriv4.PubKey()
129129

130130
// Follow the normal process of an incoming connection. We check if we
131-
// can accommodate this peer in checkIncomingConnBanScore and then we
131+
// can accommodate this peer in checkAcceptIncomingConn and then we
132132
// assign its access permissions and then insert into the map.
133133
assertInboundConnection(t, a, peerKey4, peerStatusRestricted)
134134

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,7 @@ func newServer(_ context.Context, cfg *Config, listenAddrs []net.Addr,
19081908
nodeKeyECDH, listenAddr.String(),
19091909
// TODO(yy): remove this check and unify the inbound
19101910
// connection check inside `InboundPeerConnected`.
1911-
s.peerAccessMan.checkIncomingConnBanScore,
1911+
s.peerAccessMan.checkAcceptIncomingConn,
19121912
)
19131913
if err != nil {
19141914
return nil, err

0 commit comments

Comments
 (0)