multi: remove kvdb.Tx from ChannelGraphSource.ForAllOutgoingChannels

and the same for ChannelStateDB.FetchChannel. Most of the calls to these
methods provide a `nil` Tx anyways. The only place that currently
provides a non-nil tx is in the `localchans.Manager`. It takes the
transaction provided to the `ForAllOutgoingChannels` callback and passes
it to it's `updateEdge` method. Note, however, that the
`ForAllOutgoingChannels` call is a call to the graph db and the call to
`updateEdge` is a call to the `ChannelStateDB`. There is no reason that
these two calls need to happen under the same transaction as they are
reading from two completely disjoint databases. And so in the effort to
completely split untangle the relationship between the two databases, we
now dont use the same transaction for these two calls.
This commit is contained in:
Elle Mouton
2024-10-29 18:44:51 +02:00
parent 6e13898981
commit adcaa8802f
15 changed files with 43 additions and 65 deletions

View File

@ -282,7 +282,7 @@ func initAutoPilot(svr *server, cfg *lncfg.AutoPilot,
ChannelInfo: func(chanPoint wire.OutPoint) (
*autopilot.LocalChannel, error) {
channel, err := svr.chanStateDB.FetchChannel(nil, chanPoint)
channel, err := svr.chanStateDB.FetchChannel(chanPoint)
if err != nil {
return nil, err
}