htlcswitch: add channel link config

Step №1 in making htlcManager (aka channelLink) testable:
Start use config which will allow as mock/stub external subsystems.
This commit is contained in:
Andrey Samokhvalov authored and Olaoluwa Osuntokun committed 2017-05-31 11:06:08 -07:00
1 parent 0de4ea2712
commit 7f572fc155
3 files changed
+55

No files matched your search

+5
View File
@@ -10,6 +10,7 @@ import (
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/roasbeef/btcutil"
"github.com/lightningnetwork/lnd/lnwallet"
)
type mockServer struct {
@@ -152,6 +153,10 @@ func (s *mockServer) Disconnect() {
s.t.Fatalf("server %v was disconnected", s.name)
}
func (s *mockServer) WipeChannel(*lnwallet.LightningChannel) error {
return nil
}
func (s *mockServer) Stop() {
if !atomic.CompareAndSwapInt32(&s.shutdown, 0, 1) {
return