-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Backport #12783: macOS: disable AppNap during sync (and mixing) #3024
Conversation
1e0f3c4 macOS: disable AppNap during sync (Alexey Ivanov) Pull request description: Code based on pull/5804. Tested only on macOS 10.13.3 and should support 10.9+. What macOS versions bitcoin core currently supports? Tree-SHA512: 85809b8d8d8a05169437b4268988da0b7372c29c6da3223ebdc106dc16dcb6d3caa5c52ace3591467005b50a63fd8b2ab1cb071cb4f450032932df25d5063315
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comment 🙈
@@ -950,6 +956,15 @@ void BitcoinGUI::updateHeadersSyncProgressLabel() | |||
|
|||
void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header) | |||
{ | |||
#ifdef Q_OS_MAC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my... :D
The original from Bitcoin was already bad...using the ternary operator as a replacement for if/else and at the same time relying on the side effects of the evaluation result... :D
Can you maybe change this to something as simple as:
#ifdef Q_OS_MAC
bool disableAppNap = !masternodeSync.IsSynced();
#ifdef ENABLE_WALLET
if (privateSendClient.fPrivateSendRunning) {
disableAppNap = true;
}
#endif
if (disableAppNap) {
m_app_nap_inhibitor->disableAppNap()
} else {
m_app_nap_inhibitor->enableAppNap()
}
#edif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code sample to use disableAppNap instead of enableAppNap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about 7ffb163? :) (mostly the same as yours, just changed if (privateSendClient.fPrivateSendRunning)
part)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
7ffb163
to
38cd076
Compare
Force-pushed to trigger Travis build (failure seems to be unrelated https://travis-ci.org/dashpay/dash/jobs/557206151#L2645 but just in case). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK
Was included by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK
dashpay#3024) * Merge bitcoin#12783: macOS: disable AppNap during sync 1e0f3c4 macOS: disable AppNap during sync (Alexey Ivanov) Pull request description: Code based on pull/5804. Tested only on macOS 10.13.3 and should support 10.9+. What macOS versions bitcoin core currently supports? Tree-SHA512: 85809b8d8d8a05169437b4268988da0b7372c29c6da3223ebdc106dc16dcb6d3caa5c52ace3591467005b50a63fd8b2ab1cb071cb4f450032932df25d5063315 * Refactor * Drop `#include <memory>` from `src/qt/bitcoingui.h` Was included by mistake.
dashpay#3024) * Merge bitcoin#12783: macOS: disable AppNap during sync 1e0f3c4 macOS: disable AppNap during sync (Alexey Ivanov) Pull request description: Code based on pull/5804. Tested only on macOS 10.13.3 and should support 10.9+. What macOS versions bitcoin core currently supports? Tree-SHA512: 85809b8d8d8a05169437b4268988da0b7372c29c6da3223ebdc106dc16dcb6d3caa5c52ace3591467005b50a63fd8b2ab1cb071cb4f450032932df25d5063315 * Refactor * Drop `#include <memory>` from `src/qt/bitcoingui.h` Was included by mistake.
* commit '7d8eab2641023c78a72ccd6efc99fc35fd030a46': (32 commits) Add 0.14.0.3 change log to release-notes.md (dashpay#3055) Update release-notes.md for 0.14.0.3 (dashpay#3054) Bump version to 0.14.0.3 and copy release notes (dashpay#3053) Re-verify invalid IS sigs when the active quorum set rotated (dashpay#3052) Remove recovered sigs from the LLMQ db when corresponding IS locks get confirmed (dashpay#3048) Add "instantsendlocks" to getmempoolinfo RPC (dashpay#3047) Use fEnablePrivateSend instead of fPrivateSendRunning Show number of InstantSend locks in Debug Console (dashpay#2919) Optimize on-disk deterministic masternode storage to reduce size of evodb (dashpay#3017) Add "isValidMember" and "memberIndex" to "quorum memberof" and allow to specify quorum scan count (dashpay#3009) Implement "quorum memberof" (dashpay#3004) Bail out properly on Evo DB consistency check failures in ConnectBlock/DisconnectBlock (dashpay#3044) Do not count 0-fee txes for fee estimation (dashpay#3037) Fix broken link in PrivateSend info dialog (dashpay#3031) Merge pull request dashpay#3028 from PastaPastaPasta/backport-12588 Add Dash Core Group codesign certificate (dashpay#3027) Fix osslsigncode compile issue in gitian-build (dashpay#3026) Backport bitcoin#12783: macOS: disable AppNap during sync (and mixing) (dashpay#3024) Remove support for InstantSend locked gobject collaterals (dashpay#3019) [v0.14.0.x] Update release notes for 0.14.0.2 (dashpay#3012) ... # Conflicts: # .gitignore # .travis.yml # configure.ac # doc/man/biblepay-cli.1 # doc/man/biblepay-qt.1 # doc/man/biblepay-tx.1 # doc/man/biblepayd.1 # doc/release-notes.md # src/clientversion.h # src/qt/utilitydialog.cpp
dashpay#3024) * Merge bitcoin#12783: macOS: disable AppNap during sync 1e0f3c4 macOS: disable AppNap during sync (Alexey Ivanov) Pull request description: Code based on pull/5804. Tested only on macOS 10.13.3 and should support 10.9+. What macOS versions bitcoin core currently supports? Tree-SHA512: 85809b8d8d8a05169437b4268988da0b7372c29c6da3223ebdc106dc16dcb6d3caa5c52ace3591467005b50a63fd8b2ab1cb071cb4f450032932df25d5063315 * Refactor * Drop `#include <memory>` from `src/qt/bitcoingui.h` Was included by mistake.
bitcoin#12783 1e0f3c4 macOS: disable AppNap during sync (Alexey Ivanov)
Original pull request description:
The same issue is affecting mixing (which is quite annoying), so I modified it accordingly. Tested on 10.14.5 and it seems to be working as expected. Images below are for
this patch
(2192),official 0.14.0.2 app
(2201) andcurrent develop
(2203), all started in regtest mode at ~ the same time.After a minute or so, not synced:
Forced sync (
mnsync next
), generated 1 block, waited ~1 minute:Started mixing, generated 1 more block, waited ~1 minute: