multi: extend lnpeer.Peer interface with Disconnect function

This will be used in the gossiper to disconnect from peers if their
ban score passes the ban threshold.
This commit is contained in:
Eugene Siegel
2024-08-14 14:03:39 -04:00
committed by Olaoluwa Osuntokun
parent b7c4a3cd18
commit 3e318b4187
8 changed files with 78 additions and 30 deletions

View File

@@ -79,3 +79,5 @@ func (m *MockPeer) RemoteFeatures() *lnwire.FeatureVector {
args := m.Called()
return args.Get(0).(*lnwire.FeatureVector)
}
func (m *MockPeer) Disconnect(err error) {}

View File

@@ -74,4 +74,7 @@ type Peer interface {
// by the remote peer. This allows sub-systems that use this interface
// to gate their behavior off the set of negotiated feature bits.
RemoteFeatures() *lnwire.FeatureVector
// Disconnect halts communication with the peer.
Disconnect(error)
}