routing+channeldb: migrate MC store to use minimal Route encoding

Add a new mcRoute type that houses the data about a route that MC
actually uses. Then add a migration (channeldb/migration32) that
migrates the existing store from its current serialisation to the new,
more minimal serialisation.
This commit is contained in:
Elle Mouton
2024-08-06 14:33:07 +02:00
parent 96445f99b4
commit 383a6d274f
9 changed files with 873 additions and 136 deletions

View File

@@ -208,7 +208,7 @@ type MissionControlPairSnapshot struct {
type paymentResult struct {
id uint64
timeFwd, timeReply time.Time
route *route.Route
route *mcRoute
success bool
failureSourceIdx *int
failure lnwire.FailureMessage
@@ -438,7 +438,7 @@ func (m *MissionControl) ReportPaymentFail(paymentID uint64, rt *route.Route,
id: paymentID,
failureSourceIdx: failureSourceIdx,
failure: failure,
route: rt,
route: extractMCRoute(rt),
}
return m.processPaymentResult(result)
@@ -456,7 +456,7 @@ func (m *MissionControl) ReportPaymentSuccess(paymentID uint64,
timeReply: timestamp,
id: paymentID,
success: true,
route: rt,
route: extractMCRoute(rt),
}
_, err := m.processPaymentResult(result)