Skip to content

fix: don't try to marshal a nil record#943

Merged
Stebalien merged 1 commit intomasterfrom
fix/record-panic
May 20, 2020
Merged

fix: don't try to marshal a nil record#943
Stebalien merged 1 commit intomasterfrom
fix/record-panic

Conversation

@Stebalien
Copy link
Member

fixes #939

@Stebalien Stebalien requested a review from yusefnapora May 20, 2020 01:12
if cab, ok := peerstore.GetCertifiedAddrBook(ids.Host.Peerstore()); ok {
snapshot.record = cab.GetPeerRecord(ids.Host.ID())
if snapshot.record == nil {
log.Errorf("latest peer record does not exist. identify message incomplete!")
Copy link
Contributor

Choose a reason for hiding this comment

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

not worth a log when this occurs? seems at least debug worthy

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, maybe as a debug entry. However, it'll happen whenever we don't have addresses.

Copy link
Member Author

Choose a reason for hiding this comment

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

You know, I'm going to be petty. It's not worth the extra indent I'd need to handle that case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Our debug logging is to verbose to be useful anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic with signed peer records in go-lib2p v0.9.0

2 participants