discovery: send policy updates for private channels directly to the remote peer
In this commit, we modify the main loop in `processChanPolicyUpdate` to send updates for private channels directly to the remote peer via the reliable message sender. This fixes a prior issue where the remote peer wouldn't receive new updates as this method doesn't go through the traditional path for channel updates.
This commit is contained in:
3 files changed
+97
-10
No files matched your search
@@ -146,3 +146,19 @@ func SignAnnouncement(signer lnwallet.MessageSigner, pubKey *btcec.PublicKey,
|
||||
|
||||
return signer.SignMessage(pubKey, data)
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
Reference in new issue
Block a user