Uh oh!
There was an error while loading. Please reload this page.
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
| void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header) | ||
| { | ||
| #ifdef Q_OS_MAC |
There was a problem hiding this comment.
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.
Updated the code sample to use disableAppNap instead of enableAppNap
There was a problem hiding this comment.
How about 7ffb163? :) (mostly the same as yours, just changed if (privateSendClient.fPrivateSendRunning) part)
UdjinM6
commented
Jul 11, 2019
Force-pushed to trigger Travis build (failure seems to be unrelated https://travis-ci.org/dashpay/dash/jobs/557206151#L2645 but just in case). |
Uh oh!
There was an error while loading. Please reload this page.
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
bitcoin#127831e0f3c4 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: