Skip to content

Conversation

@yyforyongyu
Copy link
Collaborator

This PR introduces some refactoring to methods like OnGetData and BtcEncode, aiming to improve readability and code health.

This commit provides a minor fix on the format.
@coveralls
Copy link

coveralls commented Jun 23, 2025

Pull Request Test Coverage Report for Build 15872035018

Details

  • 6 of 88 (6.82%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.005%) to 55.466%

Changes Missing Coverage Covered Lines Changed/Added Lines %
wire/msgaddrv2.go 6 8 75.0%
server.go 0 80 0.0%
Files with Coverage Reduction New Missed Lines %
connmgr/connmanager.go 1 84.59%
server.go 3 0.0%
Totals Coverage Status
Change from base Build 15747162533: 0.005%
Covered Lines: 31340
Relevant Lines: 56503

💛 - Coveralls

@saubyk saubyk requested a review from kcalvinalvin June 24, 2025 00:04
@saubyk saubyk added this to the v0.25 milestone Jun 24, 2025
server.go Outdated
sp.server.syncManager.QueueHeaders(msg, sp.Peer)
}

// handleGetData is invoked when a peer receives a getdata bitcoin message and
Copy link
Contributor

Choose a reason for hiding this comment

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

nit in commit message: s/prune/prone

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed!


// handleGetData is invoked when a peer receives a getdata bitcoin message and
// is used to deliver block and transaction information.
func (sp *serverPeer) OnGetData(_ *peer.Peer, msg *wire.MsgGetData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

pre-existing but the method name is incorrect

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cool now fixed

@GustavoStingelin GustavoStingelin mentioned this pull request Jun 24, 2025
7 tasks
The preivous usage of two channels - by piping them together to create a
semaphore effect, is difficult to follow and prone to bugs. This commit
now refactors the method to explicitly implement a semaphore.

Prior to this change, we would allow at max 3 concurrent goroutines -
this is now bumped to 5.
Copy link
Contributor

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

🙏

Copy link

@GustavoStingelin GustavoStingelin left a comment

Choose a reason for hiding this comment

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

Nice! tACK!

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 💃🏾

@Roasbeef Roasbeef merged commit 91daea9 into btcsuite:master Jul 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants