discovery: move remotePubFromChanInfo to gossiper, remove utils
This commit is contained in:
parent
6a813e3433
commit
7b0d564692
@ -1365,6 +1365,22 @@ func (d *AuthenticatedGossiper) processChanPolicyUpdate(
|
|||||||
return chanUpdates, nil
|
return chanUpdates, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remotePubFromChanInfo returns the public key of the remote peer given a
|
||||||
|
// ChannelEdgeInfo that describe a channel we have with them.
|
||||||
|
func remotePubFromChanInfo(chanInfo *channeldb.ChannelEdgeInfo,
|
||||||
|
chanFlags lnwire.ChanUpdateChanFlags) [33]byte {
|
||||||
|
|
||||||
|
var remotePubKey [33]byte
|
||||||
|
switch {
|
||||||
|
case chanFlags&lnwire.ChanUpdateDirection == 0:
|
||||||
|
remotePubKey = chanInfo.NodeKey2Bytes
|
||||||
|
case chanFlags&lnwire.ChanUpdateDirection == 1:
|
||||||
|
remotePubKey = chanInfo.NodeKey1Bytes
|
||||||
|
}
|
||||||
|
|
||||||
|
return remotePubKey
|
||||||
|
}
|
||||||
|
|
||||||
// processRejectedEdge examines a rejected edge to see if we can extract any
|
// processRejectedEdge examines a rejected edge to see if we can extract any
|
||||||
// new announcements from it. An edge will get rejected if we already added
|
// new announcements from it. An edge will get rejected if we already added
|
||||||
// the same edge without AuthProof to the graph. If the received announcement
|
// the same edge without AuthProof to the graph. If the received announcement
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
package discovery
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/lightningnetwork/lnd/channeldb"
|
|
||||||
"github.com/lightningnetwork/lnd/lnwire"
|
|
||||||
)
|
|
||||||
|
|
||||||
// remotePubFromChanInfo returns the public key of the remote peer given a
|
|
||||||
// ChannelEdgeInfo that describe a channel we have with them.
|
|
||||||
func remotePubFromChanInfo(chanInfo *channeldb.ChannelEdgeInfo,
|
|
||||||
chanFlags lnwire.ChanUpdateChanFlags) [33]byte {
|
|
||||||
|
|
||||||
var remotePubKey [33]byte
|
|
||||||
switch {
|
|
||||||
case chanFlags&lnwire.ChanUpdateDirection == 0:
|
|
||||||
remotePubKey = chanInfo.NodeKey2Bytes
|
|
||||||
case chanFlags&lnwire.ChanUpdateDirection == 1:
|
|
||||||
remotePubKey = chanInfo.NodeKey1Bytes
|
|
||||||
}
|
|
||||||
|
|
||||||
return remotePubKey
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user