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

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

Merged
merged 1 commit into from
May 20, 2020
Merged

Conversation

Stebalien
Copy link
Member

fixes #939

@@ -428,9 +428,6 @@ func (ids *IDService) getSnapshot() *identifySnapshot {
if !ids.disableSignedPeerRecord {
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