Skip to content

Add missing new fields to node status messages#30

Merged
oskarszoon merged 1 commit into
mainfrom
bugfix/node-status-message
Oct 21, 2025
Merged

Add missing new fields to node status messages#30
oskarszoon merged 1 commit into
mainfrom
bugfix/node-status-message

Conversation

@oskarszoon

Copy link
Copy Markdown
Contributor

Continues from #24

Why local worked but remote didn't:

  • Local node status messages are created by getNodeStatusMessage() which includes these fields
  • Remote peer messages come through handleNodeStatusTopic() which was missing the field mapping

@claude

claude Bot commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Claude finished @oskarszoon's task —— View job


Review Complete

  • Read PR diff and understand changes
  • Review the fix for correctness
  • Check for consistency with related code
  • Post review feedback

Analysis

This PR correctly adds the missing TxCount and SubtreeCount fields to the notificationMsg struct instantiation in handleNodeStatusTopic() at services/p2p/Server.go:930-931.

The Fix:

  • Local node status messages (created by getNodeStatusMessage() at line 1229-1230) already include these fields
  • Remote peer messages (handled by handleNodeStatusTopic() at line 881) were missing the field mapping
  • The fix properly maps nodeStatusMessage.TxCount and nodeStatusMessage.SubtreeCount to the notification message

Verification:

  • NodeStatusMessage struct (line 864-865) defines both fields with omitempty tags
  • notificationMsg struct (HandleWebsocket.go:32,41) has matching TxCount and SubtreeCount fields
  • Field ordering matches the struct definition (between BestHeight and FSMState)
  • Both fields use the same types: uint64 for TxCount, uint32 for SubtreeCount

Assessment:
LGTM - This is a straightforward bug fix that ensures parity between local and remote node status message handling. The change is minimal, correct, and maintains consistency with the existing codebase structure.


@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud

Copy link
Copy Markdown

@oskarszoon oskarszoon merged commit c75a591 into main Oct 21, 2025
10 checks passed
@oskarszoon oskarszoon deleted the bugfix/node-status-message branch October 21, 2025 13:40
@oskarszoon oskarszoon self-assigned this Oct 22, 2025
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.

2 participants