mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +02:00
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:
@@ -2,6 +2,7 @@ package discovery
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -74,7 +75,7 @@ func TestReliableSenderFlow(t *testing.T) {
|
||||
// Create a mock peer to send the messages to.
|
||||
pubKey := randPubKey(t)
|
||||
msgsSent := make(chan lnwire.Message)
|
||||
peer := &mockPeer{pubKey, msgsSent, reliableSender.quit}
|
||||
peer := &mockPeer{pubKey, msgsSent, reliableSender.quit, atomic.Bool{}}
|
||||
|
||||
// Override NotifyWhenOnline and NotifyWhenOffline to provide the
|
||||
// notification channels so that we can control when notifications get
|
||||
@@ -193,7 +194,7 @@ func TestReliableSenderStaleMessages(t *testing.T) {
|
||||
// Create a mock peer to send the messages to.
|
||||
pubKey := randPubKey(t)
|
||||
msgsSent := make(chan lnwire.Message)
|
||||
peer := &mockPeer{pubKey, msgsSent, reliableSender.quit}
|
||||
peer := &mockPeer{pubKey, msgsSent, reliableSender.quit, atomic.Bool{}}
|
||||
|
||||
// Override NotifyWhenOnline to provide the notification channel so that
|
||||
// we can control when notifications get dispatched.
|
||||
|
Reference in New Issue
Block a user