channeldb: refresh channel state within RefreshShortChanID
Refresh channel memory state whenever the short channel id is refreshed. This is to make the in-memory channel consistent with the disk data. Fixes #3765.
This commit is contained in:
1 parent
59c4db7f33
commit
8b3dd9415e
3 files changed
+103
-12
No files matched your search
@@ -939,8 +939,8 @@ func TestFetchWaitingCloseChannels(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestRefreshShortChanID asserts that RefreshShortChanID updates the in-memory
|
||||
// short channel ID of another OpenChannel to reflect a preceding call to
|
||||
// MarkOpen on a different OpenChannel.
|
||||
// state of another OpenChannel to reflect a preceding call to MarkOpen on a
|
||||
// different OpenChannel.
|
||||
func TestRefreshShortChanID(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -1038,4 +1038,10 @@ func TestRefreshShortChanID(t *testing.T) {
|
||||
"got %v", chanOpenLoc,
|
||||
pendingChannel.Packager.(*ChannelPackager).source)
|
||||
}
|
||||
|
||||
// Check to ensure that this channel is no longer pending and this field
|
||||
// is up to date.
|
||||
if pendingChannel.IsPending {
|
||||
t.Fatalf("channel pending state wasn't updated: want false got true")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user