diff --git a/autopilot/agent_test.go b/autopilot/agent_test.go index f3b70edf..e7b46306 100644 --- a/autopilot/agent_test.go +++ b/autopilot/agent_test.go @@ -74,11 +74,6 @@ type mockHeuristic struct { quit chan struct{} } -func (m *mockHeuristic) NeedMoreChans(chans []Channel, - balance btcutil.Amount) (btcutil.Amount, uint32, bool) { - return 0, 0, false -} - type directiveArg struct { graph ChannelGraph amt btcutil.Amount diff --git a/autopilot/interface.go b/autopilot/interface.go index e0d0cb90..a612914a 100644 --- a/autopilot/interface.go +++ b/autopilot/interface.go @@ -111,16 +111,6 @@ type AttachmentDirective struct { // the interface is to allow an auto-pilot agent to decide if it needs more // channels, and if so, which exact channels should be opened. type AttachmentHeuristic interface { - // NeedMoreChans is a predicate that should return true if, given the - // passed parameters, and its internal state, more channels should be - // opened within the channel graph. If the heuristic decides that we do - // indeed need more channels, then the second argument returned will - // represent the amount of additional funds to be used towards creating - // channels. This method should also return the exact *number* of - // additional channels that are needed in order to converge towards our - // ideal state. - NeedMoreChans(chans []Channel, balance btcutil.Amount) (btcutil.Amount, uint32, bool) - // NodeScores is a method that given the current channel graph, current // set of local channels and funds available, scores the given nodes // according to the preference of opening a channel with them. The diff --git a/autopilot/prefattach.go b/autopilot/prefattach.go index 3b5ee9a7..55587cd0 100644 --- a/autopilot/prefattach.go +++ b/autopilot/prefattach.go @@ -42,23 +42,6 @@ func NewConstrainedPrefAttachment( // AttachmentHeuristic interface. var _ AttachmentHeuristic = (*ConstrainedPrefAttachment)(nil) -// NeedMoreChans is a predicate that should return true if, given the passed -// parameters, and its internal state, more channels should be opened within -// the channel graph. If the heuristic decides that we do indeed need more -// channels, then the second argument returned will represent the amount of -// additional funds to be used towards creating channels. -// -// NOTE: This is a part of the AttachmentHeuristic interface. -func (p *ConstrainedPrefAttachment) NeedMoreChans(channels []Channel, - funds btcutil.Amount) (btcutil.Amount, uint32, bool) { - - // We'll try to open more channels as long as the constraints allow it. - availableFunds, availableChans := p.constraints.ChannelBudget( - channels, funds, - ) - return availableFunds, availableChans, availableChans > 0 -} - // NodeID is a simple type that holds an EC public key serialized in compressed // format. type NodeID [33]byte