channeldb/migration: add migration for new payment bucket structure

migrateOutgoingPayments moves the OutgoingPayments into a new bucket format
where they all reside in a top-level bucket indexed by the payment hash. In
this sub-bucket we store information relevant to this payment, such as the
payment status.

To avoid that the router resend payments that have the status InFlight (we
cannot resume these payments for pre-migration payments) we delete those
statuses, so only Completed payments remain in the new bucket structure.
This commit is contained in:
Johan T. Halseth committed 2019-05-27 20:18:56 +02:00
1 parent 178996f0d3
commit 801521ed2d
2 files changed
+203

No files matched your search

+7
View File
@@ -96,6 +96,13 @@ var (
number: 8,
migration: migrateGossipMessageStoreKeys,
},
{
// The DB version where the payments and payment
// statuses are moved to being stored in a combined
// bucket.
number: 9,
migration: migrateOutgoingPayments,
},
}
// Big endian is the preferred byte order, due to cursor scans over