Backport #12783: macOS: disable AppNap during sync (and mixing)#3024
Merged
UdjinM6 merged 3 commits intodashpay:developfrom Jul 15, 2019
Merged
Backport #12783: macOS: disable AppNap during sync (and mixing)#3024UdjinM6 merged 3 commits intodashpay:developfrom
UdjinM6 merged 3 commits intodashpay:developfrom
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
codablock
reviewed
Jul 11, 2019
|
|
||
| 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
Author
There was a problem hiding this comment.
How about 7ffb163? :) (mostly the same as yours, just changed if (privateSendClient.fPrivateSendRunning) part)
7ffb163 to
38cd076
Compare
Author
|
Force-pushed to trigger Travis build (failure seems to be unrelated https://travis-ci.org/dashpay/dash/jobs/557206151#L2645 but just in case). |
Was included by mistake.
codablock
pushed a commit
to codablock/dash
that referenced
this pull request
Aug 7, 2019
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.
MIPPL
pushed a commit
to biblepay/biblepay
that referenced
this pull request
Nov 20, 2019
* 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
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.
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: