channeldb+funding: move opening channel state to DB

The funding manager doesn't need to know the details of the underlying
storage of the opening channel state, so we move the actual store and
retrieval into the channel database.
This commit is contained in:
Oliver Gugger
2021-09-21 19:18:14 +02:00
parent 60cccf8409
commit c1f686f860
3 changed files with 87 additions and 72 deletions

View File

@@ -922,12 +922,12 @@ func assertDatabaseState(t *testing.T, node *testNode,
}
state, _, err = node.fundingMgr.getChannelOpeningState(
fundingOutPoint)
if err != nil && err != ErrChannelNotFound {
if err != nil && err != channeldb.ErrChannelNotFound {
t.Fatalf("unable to get channel state: %v", err)
}
// If we found the channel, check if it had the expected state.
if err != ErrChannelNotFound && state == expectedState {
if err != channeldb.ErrChannelNotFound && state == expectedState {
// Got expected state, return with success.
return
}
@@ -1165,7 +1165,7 @@ func assertErrChannelNotFound(t *testing.T, node *testNode,
}
state, _, err = node.fundingMgr.getChannelOpeningState(
fundingOutPoint)
if err == ErrChannelNotFound {
if err == channeldb.ErrChannelNotFound {
// Got expected state, return with success.
return
} else if err != nil {