server.go+accessman.go: introduce caches for access permissions

Here we introduce the access manager which has caches that will
determine the access control status of our peers. Peers that have
had their funding transaction confirm with us are protected. Peers
that only have pending-open channels with us are temporary access
and can have their access revoked. The rest of the peers are granted
restricted access.
This commit is contained in:
Eugene Siegel
2025-01-16 10:32:34 -05:00
parent 4cfc92f420
commit 6eb746fbba
10 changed files with 788 additions and 53 deletions

View File

@@ -90,6 +90,9 @@ const (
// torTimeoutMultiplier is the scaling factor we use on network timeouts
// for Tor peers.
torTimeoutMultiplier = 3
// msgStreamSize is the size of the message streams.
msgStreamSize = 5
)
var (
@@ -1856,7 +1859,7 @@ func newChanMsgStream(p *Brontide, cid lnwire.ChannelID) *msgStream {
return newMsgStream(p,
fmt.Sprintf("Update stream for ChannelID(%x) created", cid[:]),
fmt.Sprintf("Update stream for ChannelID(%x) exiting", cid[:]),
1000,
msgStreamSize,
apply,
)
}
@@ -1875,7 +1878,7 @@ func newDiscMsgStream(p *Brontide) *msgStream {
p,
"Update stream for gossiper created",
"Update stream for gossiper exited",
1000,
msgStreamSize,
apply,
)
}