fix/refactor(qt): address CodeRabbit review feedback on client_feeds#1
Open
thepastaclaw wants to merge 18 commits intokwvg:client_feedsfrom
Open
fix/refactor(qt): address CodeRabbit review feedback on client_feeds#1thepastaclaw wants to merge 18 commits intokwvg:client_feedsfrom
thepastaclaw wants to merge 18 commits intokwvg:client_feedsfrom
Conversation
Will be needed as we start consolidating non-wallet data sourcing into a central thread to prevent duplicated fetching. Review with `git log -p -n1 --color-moved=dimmed_zebra --ignore-space-change`.
The current system spins up threads for each wallet instance, this is not sustainable for clients that load a lot of wallets and is computationally expensive for redundant fetches
Same reasoning as previous commit and we consolidate two loops while we're at it. Review with `git log -p -n1 --color-moved=dimmed_zebra --ignore-space-change`.
m_syncing is written by setSyncing() from the main thread and read by requestRefresh() from the worker thread, constituting a data race on a plain bool. Use std::atomic<bool> to make the access thread-safe. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After quit()+wait(), the worker thread's event loop is gone, so the deleteLater() queued via the QThread::finished connection will never execute. Explicitly delete m_worker to prevent a memory leak. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The numBlocksChanged handler was refreshing the proposal feed but not the masternode feed. Add m_feed_masternode->requestRefresh() so that masternode data (e.g. next payment projections) stays current as new blocks arrive. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The comment said "Governance Manager page widget" which is inaccurate; ProposalList displays governance proposals, not the masternode manager. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The inner loop variable 'dmn' shadowed the outer structured binding 'dmn' from getMasternodeList(). Rename it to 'payee' to eliminate the shadowing warning and improve readability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…delist The m_thread member was removed from MasternodeList, making the QThread forward declaration and include unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CDeterministicMNList is not referenced in any ProposalList member declarations or method signatures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace three separate connect() calls from proposalCreate's accepted signal with a single lambda that performs all three actions in order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sternodeEntryList Both Proposals and MasternodeEntryList were defined in clientfeeds.h as well as their canonical locations (proposalmodel.h and masternodemodel.h respectively). Remove the duplicates from clientfeeds.h and include the model headers instead, improving discoverability and single-source-of-truth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5f71299 to
3d64056
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses all 10 code review items from the CodeRabbit review on dashpay/dash#7146.
Commits (9 total, items 9+10 combined)
51a0b865std::atomic<bool>form_syncingto prevent data race77ffa855delete m_workerinClientFeeds::stop()4aa1889cm_feed_masternode->requestRefresh()on block height updatesc10b4f59ProposalListe16bd382dmn→payeeinMasternodeFeed::fetch()cdbbf7d1QThreadforward declaration + include from masternodelist669cfa84CDeterministicMNListforward declaration99ecc629QDialog::acceptedconnections into 1 lambda9838e6feProposalsandMasternodeEntryListtype aliases intoclientfeeds.hReview Items Addressed
m_syncing→std::atomic<bool>delete m_workerinstop()accepted()signal connections🤖 This was generated by an automated review bot.
Don't want automated PRs or comments on your code? You can opt out by replying here or messaging @PastaPastaPasta on Slack — we'll make sure the bot skips your PRs/repos going forward.