Merge pull request #2074 from Roasbeef/chan-close-summary-fix-short-chan-remote-node

lnwallet: properly set the short chan ID for remote unilateral close …
This commit is contained in:
Johan T. Halseth 2018-10-22 18:16:41 -07:00 committed by GitHub
commit 0e683d895b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

@ -5109,6 +5109,7 @@ func NewUnilateralCloseSummary(chanState *channeldb.OpenChannel, signer Signer,
IsPending: true,
RemoteCurrentRevocation: chanState.RemoteCurrentRevocation,
RemoteNextRevocation: chanState.RemoteNextRevocation,
ShortChanID: chanState.ShortChanID(),
LocalChanConfig: chanState.LocalChanCfg,
}

@ -4805,6 +4805,16 @@ func TestChannelUnilateralClosePendingCommit(t *testing.T) {
t.Fatalf("unable to find alice's commit resolution")
}
// The proper short channel ID should also be set in Alice's close
// channel summary.
if aliceCloseSummary.ChannelCloseSummary.ShortChanID !=
aliceChannel.ShortChanID() {
t.Fatalf("wrong short chan ID, expected %v got %v",
aliceChannel.ShortChanID(),
aliceCloseSummary.ChannelCloseSummary.ShortChanID)
}
aliceSignDesc := aliceCloseSummary.CommitResolution.SelfOutputSignDesc
// Finally, we'll ensure that we're able to properly sweep our output