mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 16:12:55 +02:00
channeldb: store unknown policies in database
The commit ensures that for every channel, there will always be two entries in the edges bucket. If the policy from one or both ends of the channel is unknown, it is marked as such. This allows efficient lookup of incoming edges. This is required for backwards payment path finding.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
d2612e51bd
commit
6c918a1806
@@ -3733,6 +3733,12 @@ func (r *rpcServer) FeeReport(ctx context.Context,
|
||||
err = selfNode.ForEachChannel(nil, func(_ *bolt.Tx, chanInfo *channeldb.ChannelEdgeInfo,
|
||||
edgePolicy, _ *channeldb.ChannelEdgePolicy) error {
|
||||
|
||||
// Self node should always have policies for its channels.
|
||||
if edgePolicy == nil {
|
||||
return fmt.Errorf("no policy for outgoing channel %v ",
|
||||
chanInfo.ChannelID)
|
||||
}
|
||||
|
||||
// We'll compute the effective fee rate by converting from a
|
||||
// fixed point fee rate to a floating point fee rate. The fee
|
||||
// rate field in the database the amount of mSAT charged per
|
||||
|
Reference in New Issue
Block a user