mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 21:51:27 +02:00
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:
@@ -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,
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user