Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lnwallet: fix panic on aux sig handling #9120

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lnwallet/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -5553,6 +5553,11 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
// disk later.
sigType := htlcCustomSigType.TypeVal()
auxSig.WhenSome(func(sigB tlv.Blob) {
Copy link
Collaborator Author

@GeorgeTsagk GeorgeTsagk Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This panic behavior was exposed on this litd itest

Not sure if I should do the nil check, as is now, or if I should instead correctly initialize the map.

This current diff seems to be satisfying for the itest linked above

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should initialize the map correctly instead. Interestingly I ran into the same thing in part 3 of the rebased series today. I did the initialization on nil there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it looks in master now:

			if htlc.CustomRecords == nil {
				htlc.CustomRecords = make(lnwire.CustomRecords)
			}

See 83fdbda

if htlc.CustomRecords == nil {
htlc.CustomRecords =
make(lnwire.CustomRecords)
}

htlc.CustomRecords[uint64(sigType)] = sigB
})

Expand Down
Loading