graph/db: migrate channels and polices to SQL
In this commit, the `MigrateGraphToSQL` function is expanded to migrate the channel and channe policy data. Both of these have the special case where the kvdb store records may contain invalid TLV. If we encounter a channel with invalid TLV, we skip it and its policies. If we encounter a policy with invalid TLV, we skip it. The `TestMigrateGraphToSQL` and `TestMigrationWithChannelDB` tests are updated accordingly.
This commit is contained in:
3 files changed
+714
-5
No files matched your search
@@ -4497,8 +4497,9 @@ func putChanEdgePolicy(edges kvdb.RwBucket, edge *models.ChannelEdgePolicy,
|
||||
//
|
||||
// TODO(halseth): get rid of these invalid policies in a
|
||||
// migration.
|
||||
// TODO(elle): complete the above TODO in migration from kvdb
|
||||
// to SQL.
|
||||
//
|
||||
// NOTE: the above TODO was completed in the SQL migration and
|
||||
// so such edge cases no longer need to be handled there.
|
||||
oldEdgePolicy, err := deserializeChanEdgePolicy(
|
||||
bytes.NewReader(edgeBytes),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user