mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge #19025: [0.19] Backports
be951470be
Updated appveyor job to checkout a specific vcpkg commit ID. (Aaron Clauson)1fd9cd2cb4
appveyor: Remove clcache (MarcoFalke)8c0a9595ec
Remove cached directories and associated script blocks from appveyor CI configuration. (Aaron Clauson)d70f700021
lint: fix shellcheck URL in CI install (fanquake)f8f7d91b80
test: remove Cirrus CI FreeBSD job (fanquake)b7e16a82c9
Add missing QPainterPath include (Andrew Chow)30a28146ac
gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged (João Barbosa)0d87a5b4e2
QA: feature_segwit: Check that template "rules" includes "!segwit" as appropriate (Luke Dashjr)bde6a5a676
Bugfix: Include "csv","!segwit" in "rules" (Luke Dashjr)e422f65aee
build: Set libevent minimum version to 2.0.21 (Hennadii Stepanov)0d0dd6ae96
Update with new Windows code signing certificate (Andrew Chow) Pull request description: Backports the following to the 0.19 branch: * #17946 - Fix GBT: Restore "!segwit" and "csv" to "rules" key * #18160 - gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged * #18425 - releases: Update with new Windows code signing certificate * #18676 - build: Check libevent minimum version in configure script * #19097 - qt: Add missing QPainterPath include (as per #19510) * #18640 - appveyor: Remove clcache * #19444 - test: Remove cached directories and associated script blocks from appveyor config * #19612 - lint: fix shellcheck URL in CI install * #18001 - Updated appveyor job to checkout a specific vcpkg commit ID Closes: #19510. ACKs for top commit: jnewbery: ACKbe951470be
MarcoFalke: cherry-pick ACKbe951470be
🌎 Tree-SHA512: 2ec7e3ae1da99799ff6f8cfe26095d6885cffe6952b18a7e236dc5e657b3918225c2601b8c8e17cdff5319c40cb0a214d9fad49b0ff2f54af1db7c81d83a1df5
This commit is contained in:
commit
28a9df7d76
12 changed files with 75 additions and 129 deletions
|
@ -5,78 +5,54 @@ configuration: Release
|
|||
platform: x64
|
||||
clone_depth: 5
|
||||
environment:
|
||||
APPVEYOR_SAVE_CACHE_ON_ERROR: true
|
||||
CLCACHE_SERVER: 1
|
||||
PATH: 'C:\Python37-x64;C:\Python37-x64\Scripts;%PATH%'
|
||||
PYTHONUTF8: 1
|
||||
QT_DOWNLOAD_URL: 'https://github.com/sipsorcery/qt_win_binary/releases/download/v1.6/Qt5.9.8_x64_static_vs2019.zip'
|
||||
QT_DOWNLOAD_HASH: '9a8c6eb20967873785057fdcd329a657c7f922b0af08c5fde105cc597dd37e21'
|
||||
QT_LOCAL_PATH: 'C:\Qt5.9.8_x64_static_vs2019'
|
||||
VCPKG_INSTALL_PATH: 'C:\tools\vcpkg\installed'
|
||||
cache:
|
||||
- C:\tools\vcpkg\installed -> build_msvc\vcpkg-packages.txt
|
||||
- C:\Users\appveyor\clcache -> .appveyor.yml, build_msvc\**, **\Makefile.am, **\*.vcxproj.in
|
||||
- C:\Qt5.9.8_x64_static_vs2019
|
||||
VCPKG_COMMIT_ID: 'ed0df8ecc4ed7e755ea03e18aaf285fd9b4b4a74'
|
||||
install:
|
||||
- cmd: pip install --quiet git+https://github.com/frerich/clcache.git@v4.2.0
|
||||
# Disable zmq test for now since python zmq library on Windows would cause Access violation sometimes.
|
||||
# - cmd: pip install zmq
|
||||
# Powershell block below is to install the c++ dependencies via vcpkg. The pseudo code is:
|
||||
# 1. Check whether the vcpkg install directory exists (note that updating the vcpkg-packages.txt file
|
||||
# will cause the appveyor cache rules to invalidate the directory)
|
||||
# 2. If the directory is missing:
|
||||
# a. Update the vcpkg source (including port files) and build the vcpkg binary,
|
||||
# a. Checkout the vcpkg source (including port files) for the specific checkout and build the vcpkg binary,
|
||||
# b. Install the missing packages.
|
||||
- ps: |
|
||||
$env:PACKAGES = Get-Content -Path build_msvc\vcpkg-packages.txt
|
||||
Write-Host "vcpkg list: $env:PACKAGES"
|
||||
if(!(Test-Path -Path ($env:VCPKG_INSTALL_PATH))) {
|
||||
cd c:\tools\vcpkg
|
||||
$env:GIT_REDIRECT_STDERR = '2>&1' # git is writing non-errors to STDERR when doing git pull. Send to STDOUT instead.
|
||||
git pull origin master
|
||||
.\bootstrap-vcpkg.bat
|
||||
Add-Content "C:\tools\vcpkg\triplets\$env:PLATFORM-windows-static.cmake" "set(VCPKG_BUILD_TYPE release)"
|
||||
.\vcpkg install --triplet $env:PLATFORM-windows-static $env:PACKAGES.split() > $null
|
||||
cd "$env:APPVEYOR_BUILD_FOLDER"
|
||||
}
|
||||
else {
|
||||
Write-Host "required vcpkg packages already installed."
|
||||
}
|
||||
c:\tools\vcpkg\vcpkg integrate install
|
||||
Write-Host "vcpkg installing packages: $env:PACKAGES"
|
||||
cd c:\tools\vcpkg
|
||||
$env:GIT_REDIRECT_STDERR = '2>&1' # git is writing non-errors to STDERR when doing git pull. Send to STDOUT instead.
|
||||
git pull origin master > $null
|
||||
git checkout $env:VCPKG_COMMIT_ID
|
||||
git -c advice.detachedHead=false checkout $env:VCPKG_COMMIT_ID
|
||||
.\bootstrap-vcpkg.bat > $null
|
||||
Add-Content "C:\tools\vcpkg\triplets\$env:PLATFORM-windows-static.cmake" "set(VCPKG_BUILD_TYPE release)"
|
||||
.\vcpkg install --triplet $env:PLATFORM-windows-static $env:PACKAGES.split() > $null
|
||||
Write-Host "vcpkg packages installed successfully."
|
||||
.\vcpkg integrate install
|
||||
cd "$env:APPVEYOR_BUILD_FOLDER"
|
||||
before_build:
|
||||
- ps: clcache -M 536870912
|
||||
# Powershell block below is to download and extract the Qt static libraries. The pseudo code is:
|
||||
# 1. If the Qt destination directory exists assume it is correct and do nothing. To
|
||||
# force a fresh install of the packages delete the job's appveyor cache.
|
||||
# 2. Otherwise:
|
||||
# a. Download the zip file with the prebuilt Qt static libraries.
|
||||
# b. Check that the downloaded file matches the expected hash.
|
||||
# c. Extract the zip file to the specific destination path expected by the msbuild projects.
|
||||
- ps: |
|
||||
if(!(Test-Path -Path ($env:QT_LOCAL_PATH))) {
|
||||
Write-Host "Downloading Qt binaries.";
|
||||
Invoke-WebRequest -Uri $env:QT_DOWNLOAD_URL -Out qtdownload.zip;
|
||||
Write-Host "Qt binaries successfully downloaded, checking hash against $env:QT_DOWNLOAD_HASH...";
|
||||
if((Get-FileHash qtdownload.zip).Hash -eq $env:QT_DOWNLOAD_HASH) {
|
||||
Expand-Archive qtdownload.zip -DestinationPath $env:QT_LOCAL_PATH;
|
||||
Write-Host "Qt binary download matched the expected hash.";
|
||||
}
|
||||
else {
|
||||
Write-Host "ERROR: Qt binary download did not match the expected hash.";
|
||||
Exit-AppveyorBuild;
|
||||
}
|
||||
Write-Host "Downloading Qt binaries.";
|
||||
Invoke-WebRequest -Uri $env:QT_DOWNLOAD_URL -Out qtdownload.zip;
|
||||
Write-Host "Qt binaries successfully downloaded, checking hash against $env:QT_DOWNLOAD_HASH...";
|
||||
if((Get-FileHash qtdownload.zip).Hash -eq $env:QT_DOWNLOAD_HASH) {
|
||||
Expand-Archive qtdownload.zip -DestinationPath $env:QT_LOCAL_PATH;
|
||||
Write-Host "Qt binary download matched the expected hash.";
|
||||
}
|
||||
else {
|
||||
Write-Host "Qt binaries already present.";
|
||||
Write-Host "ERROR: Qt binary download did not match the expected hash.";
|
||||
Exit-AppveyorBuild;
|
||||
}
|
||||
- cmd: python build_msvc\msvc-autogen.py
|
||||
- ps: Start-Process clcache-server
|
||||
- ps: fsutil behavior set disablelastaccess 0 # Enable Access time feature on Windows (for clcache)
|
||||
build_script:
|
||||
- cmd: msbuild /p:TrackFileAccess=false /p:CLToolExe=clcache.exe build_msvc\bitcoin.sln /m /v:q /nologo
|
||||
- cmd: msbuild /p:TrackFileAccess=false build_msvc\bitcoin.sln /m /v:q /nologo
|
||||
after_build:
|
||||
- ps: fsutil behavior set disablelastaccess 1 # Disable Access time feature on Windows (better performance)
|
||||
- ps: clcache -z
|
||||
#- 7z a bitcoin-%APPVEYOR_BUILD_VERSION%.zip %APPVEYOR_BUILD_FOLDER%\build_msvc\%platform%\%configuration%\*.exe
|
||||
test_script:
|
||||
- cmd: src\test_bitcoin.exe -k stdout -e stdout 2> NUL
|
||||
|
|
30
.cirrus.yml
30
.cirrus.yml
|
@ -1,33 +1,3 @@
|
|||
task:
|
||||
name: "FreeBsd 12.0 amd64 [GOAL: install] [no depends, only system libs]"
|
||||
freebsd_instance:
|
||||
image: freebsd-12-0-release-amd64
|
||||
cpu: 8
|
||||
memory: 8G
|
||||
timeout_in: 60m
|
||||
env:
|
||||
MAKEJOBS: "-j9"
|
||||
CONFIGURE_OPTS: "--disable-dependency-tracking"
|
||||
GOAL: "install"
|
||||
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
|
||||
CCACHE_SIZE: "200M"
|
||||
CCACHE_COMPRESS: 1
|
||||
CCACHE_DIR: "/tmp/ccache_dir"
|
||||
ccache_cache:
|
||||
folder: "/tmp/ccache_dir"
|
||||
install_script:
|
||||
- pkg install -y autoconf automake boost-libs git gmake libevent libtool openssl pkgconf python3 ccache
|
||||
- ./contrib/install_db4.sh $(pwd)
|
||||
- ccache --max-size=${CCACHE_SIZE}
|
||||
configure_script:
|
||||
- ./autogen.sh
|
||||
- ./configure ${CONFIGURE_OPTS} BDB_LIBS="-L$(pwd)/db4/lib -ldb_cxx-4.8" BDB_CFLAGS="-I$(pwd)/db4/include" || ( cat config.log && false)
|
||||
make_script:
|
||||
- gmake ${MAKEJOBS} ${GOAL} || ( echo "Build failure. Verbose build follows." && gmake ${GOAL} V=1 ; false )
|
||||
check_script:
|
||||
- gmake check ${MAKEJOBS} VERBOSE=1
|
||||
functional_test_script:
|
||||
- ./test/functional/test_runner.py --jobs 9 --ci --extended --exclude feature_dbcrash --combinedlogslen=1000 --quiet --failfast
|
||||
task:
|
||||
name: "x86_64 Linux [GOAL: install] [bionic] [Using ./ci/ system]"
|
||||
container:
|
||||
|
|
|
@ -10,5 +10,5 @@ travis_retry pip3 install codespell==1.15.0
|
|||
travis_retry pip3 install flake8==3.7.8
|
||||
|
||||
SHELLCHECK_VERSION=v0.6.0
|
||||
curl -s "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
|
||||
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
|
||||
export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
|
||||
|
|
|
@ -1237,9 +1237,9 @@ if test x$use_pkgconfig = xyes; then
|
|||
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
|
||||
fi
|
||||
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
|
||||
PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)])
|
||||
PKG_CHECK_MODULES([EVENT], [libevent >= 2.0.21],, [AC_MSG_ERROR(libevent version 2.0.21 or greater not found.)])
|
||||
if test x$TARGET_OS != xwindows; then
|
||||
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)])
|
||||
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads >= 2.0.21],, [AC_MSG_ERROR(libevent_pthreads version 2.0.21 or greater not found.)])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIFcTCCBFmgAwIBAgIRALWcUnSOxv9FQW3xdaMDO6swDQYJKoZIhvcNAQELBQAw
|
||||
MIIFdDCCBFygAwIBAgIRAL98pqZb/N9LuNaNxKsHNGQwDQYJKoZIhvcNAQELBQAw
|
||||
fDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
|
||||
A1UEBxMHU2FsZm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMSQw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X
|
||||
aHR0cDovL29jc3Auc2VjdGlnby5jb20wKwYDVR0RBCQwIoEgam9uYXNAYml0Y29p
|
||||
bmNvcmVjb2Rlc2lnbmluZy5vcmcwDQYJKoZIhvcNAQELBQADggEBAAU59qJzQ2ED
|
||||
aTMIQTsU01zIhZJ/xwQh78i0v2Mnr46RvzYrZOev+btF3SyUYD8veNnbYlY6yEYq
|
||||
Vb+/PQnE3t1xlqR80qiTZCk/Wmxx/qKvQuWeRL5QQgvsCmWBpycQ7PNfwzOWxbPE
|
||||
b0Hb2/VFFZfR9iltkfeInRUrzS96CJGYtm7dMf2JtnXYBcwpn1N8BSMH4nXVyN8g
|
||||
VEE5KyjE7+/awYiSST7+e6Y7FE5AJ4f3FjqnRm+2XetTVqITwMLKZMoV283nSEeH
|
||||
fA4FNAMGz9QeV38ol65NNqFP2vSSgVoPK79orqH9OOW2LSobt2qun+euddJIQeYV
|
||||
CMP90b/2WPc=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
|
||||
|
|
|
@ -13,7 +13,7 @@ These are the dependencies currently used by Bitcoin Core. You can find instruct
|
|||
| FreeType | [2.7.1](https://download.savannah.gnu.org/releases/freetype) | | No | | |
|
||||
| GCC | | [4.8+](https://gcc.gnu.org/) (C++11 support) | | | |
|
||||
| HarfBuzz-NG | | | | | |
|
||||
| libevent | [2.1.8-stable](https://github.com/libevent/libevent/releases) | 2.0.22 | No | | |
|
||||
| libevent | [2.1.8-stable](https://github.com/libevent/libevent/releases) | [2.0.21](https://github.com/bitcoin/bitcoin/pull/18676) | No | | |
|
||||
| libpng | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk) |
|
||||
| librsvg | | | | | |
|
||||
| MiniUPnPc | [2.0.20180203](http://miniupnp.free.fr/files) | | No | | |
|
||||
|
|
|
@ -359,16 +359,17 @@ public:
|
|||
}
|
||||
return result;
|
||||
}
|
||||
bool tryGetBalances(WalletBalances& balances, int& num_blocks) override
|
||||
bool tryGetBalances(WalletBalances& balances, int& num_blocks, bool force, int cached_num_blocks) override
|
||||
{
|
||||
auto locked_chain = m_wallet->chain().lock(true /* try_lock */);
|
||||
if (!locked_chain) return false;
|
||||
num_blocks = locked_chain->getHeight().get_value_or(-1);
|
||||
if (!force && num_blocks == cached_num_blocks) return false;
|
||||
TRY_LOCK(m_wallet->cs_wallet, locked_wallet);
|
||||
if (!locked_wallet) {
|
||||
return false;
|
||||
}
|
||||
balances = getBalances();
|
||||
num_blocks = locked_chain->getHeight().get_value_or(-1);
|
||||
return true;
|
||||
}
|
||||
CAmount getBalance() override { return m_wallet->GetBalance().m_mine_trusted; }
|
||||
|
|
|
@ -198,8 +198,11 @@ public:
|
|||
//! Get balances.
|
||||
virtual WalletBalances getBalances() = 0;
|
||||
|
||||
//! Get balances if possible without blocking.
|
||||
virtual bool tryGetBalances(WalletBalances& balances, int& num_blocks) = 0;
|
||||
//! Get balances if possible without waiting for chain and wallet locks.
|
||||
virtual bool tryGetBalances(WalletBalances& balances,
|
||||
int& num_blocks,
|
||||
bool force,
|
||||
int cached_num_blocks) = 0;
|
||||
|
||||
//! Get balance.
|
||||
virtual CAmount getBalance() = 0;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <qt/clientmodel.h>
|
||||
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QColor>
|
||||
#include <QTimer>
|
||||
|
||||
|
|
|
@ -77,21 +77,18 @@ void WalletModel::pollBalanceChanged()
|
|||
// rescan.
|
||||
interfaces::WalletBalances new_balances;
|
||||
int numBlocks = -1;
|
||||
if (!m_wallet->tryGetBalances(new_balances, numBlocks)) {
|
||||
if (!m_wallet->tryGetBalances(new_balances, numBlocks, fForceCheckBalanceChanged, cachedNumBlocks)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(fForceCheckBalanceChanged || numBlocks != cachedNumBlocks)
|
||||
{
|
||||
fForceCheckBalanceChanged = false;
|
||||
fForceCheckBalanceChanged = false;
|
||||
|
||||
// Balance and number of transactions might have changed
|
||||
cachedNumBlocks = numBlocks;
|
||||
// Balance and number of transactions might have changed
|
||||
cachedNumBlocks = numBlocks;
|
||||
|
||||
checkBalanceChanged(new_balances);
|
||||
if(transactionTableModel)
|
||||
transactionTableModel->updateConfirmations();
|
||||
}
|
||||
checkBalanceChanged(new_balances);
|
||||
if(transactionTableModel)
|
||||
transactionTableModel->updateConfirmations();
|
||||
}
|
||||
|
||||
void WalletModel::checkBalanceChanged(const interfaces::WalletBalances& new_balances)
|
||||
|
|
|
@ -576,6 +576,8 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
|
|||
result.pushKV("capabilities", aCaps);
|
||||
|
||||
UniValue aRules(UniValue::VARR);
|
||||
aRules.push_back("csv");
|
||||
if (!fPreSegWit) aRules.push_back("!segwit");
|
||||
UniValue vbavailable(UniValue::VOBJ);
|
||||
for (int j = 0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) {
|
||||
Consensus::DeploymentPos pos = Consensus::DeploymentPos(j);
|
||||
|
|
|
@ -107,12 +107,7 @@ class SegWitTest(BitcoinTestFramework):
|
|||
assert tmpl['sigoplimit'] == 20000
|
||||
assert tmpl['transactions'][0]['hash'] == txid
|
||||
assert tmpl['transactions'][0]['sigops'] == 2
|
||||
tmpl = self.nodes[0].getblocktemplate({'rules': ['segwit']})
|
||||
assert tmpl['sizelimit'] == 1000000
|
||||
assert 'weightlimit' not in tmpl
|
||||
assert tmpl['sigoplimit'] == 20000
|
||||
assert tmpl['transactions'][0]['hash'] == txid
|
||||
assert tmpl['transactions'][0]['sigops'] == 2
|
||||
assert '!segwit' not in tmpl['rules']
|
||||
self.nodes[0].generate(1) # block 162
|
||||
|
||||
balance_presetup = self.nodes[0].getbalance()
|
||||
|
@ -212,6 +207,7 @@ class SegWitTest(BitcoinTestFramework):
|
|||
assert tmpl['sigoplimit'] == 80000
|
||||
assert tmpl['transactions'][0]['txid'] == txid
|
||||
assert tmpl['transactions'][0]['sigops'] == 8
|
||||
assert '!segwit' in tmpl['rules']
|
||||
|
||||
self.nodes[0].generate(1) # Mine a block to clear the gbt cache
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue