diff options
-rw-r--r-- | build-aux/m4/bitcoin_qt.m4 | 6 | ||||
-rw-r--r-- | doc/bips.md | 7 | ||||
-rw-r--r-- | doc/release-notes-15584.md | 4 | ||||
-rw-r--r-- | doc/release-notes-16185.md | 6 | ||||
-rw-r--r-- | doc/release-notes-16512.md | 4 | ||||
-rw-r--r-- | doc/release-notes-16695.md | 5 | ||||
-rw-r--r-- | doc/release-notes-16787.md | 3 | ||||
-rw-r--r-- | doc/release-notes.md | 22 | ||||
-rw-r--r-- | doc/release-process.md | 6 | ||||
-rw-r--r-- | src/chainparams.cpp | 28 | ||||
-rw-r--r-- | src/init.cpp | 2 | ||||
-rw-r--r-- | src/qt/bitcoin.cpp | 3 | ||||
-rw-r--r-- | src/qt/test/addressbooktests.cpp | 2 | ||||
-rw-r--r-- | src/qt/test/apptests.cpp | 2 | ||||
-rw-r--r-- | src/qt/test/test_main.cpp | 4 | ||||
-rw-r--r-- | src/qt/test/wallettests.cpp | 8 | ||||
-rw-r--r-- | src/qt/transactiondesc.cpp | 58 | ||||
-rw-r--r-- | src/script/sign.cpp | 23 | ||||
-rw-r--r-- | src/util/threadnames.cpp | 2 | ||||
-rwxr-xr-x | test/functional/rpc_net.py | 2 |
20 files changed, 116 insertions, 81 deletions
diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index 675fb6d3fb..d579dc2ed5 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -228,7 +228,11 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ ],[ bitcoin_enable_qt=no ]) - AC_MSG_RESULT([$bitcoin_enable_qt (Qt5)]) + if test x$bitcoin_enable_qt = xyes; then + AC_MSG_RESULT([$bitcoin_enable_qt ($QT_LIB_PREFIX)]) + else + AC_MSG_RESULT([$bitcoin_enable_qt]) + fi AC_SUBST(QT_PIE_FLAGS) AC_SUBST(QT_INCLUDES) diff --git a/doc/bips.md b/doc/bips.md index 3085fa424b..71ff5552ee 100644 --- a/doc/bips.md +++ b/doc/bips.md @@ -1,4 +1,4 @@ -BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.18.0**): +BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.19.0**): * [`BIP 9`](https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki): The changes allowing multiple soft-forks to be deployed in parallel have been implemented since **v0.12.1** ([PR #7575](https://github.com/bitcoin/bitcoin/pull/7575)) * [`BIP 11`](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki): Multisig outputs are standard since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)). @@ -19,12 +19,12 @@ BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.18.0**): * [`BIP 65`](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki): The CHECKLOCKTIMEVERIFY softfork was merged in **v0.12.0** ([PR #6351](https://github.com/bitcoin/bitcoin/pull/6351)), and backported to **v0.11.2** and **v0.10.4**. Mempool-only CLTV was added in [PR #6124](https://github.com/bitcoin/bitcoin/pull/6124). * [`BIP 66`](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki): The strict DER rules and associated version 3 blocks have been implemented since **v0.10.0** ([PR #5713](https://github.com/bitcoin/bitcoin/pull/5713)). * [`BIP 68`](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki): Sequence locks have been implemented as of **v0.12.1** ([PR #7184](https://github.com/bitcoin/bitcoin/pull/7184)), and have been activated since *block 419328*. -* [`BIP 70`](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) [`71`](https://github.com/bitcoin/bips/blob/master/bip-0071.mediawiki) [`72`](https://github.com/bitcoin/bips/blob/master/bip-0072.mediawiki): Payment Protocol support has been available in Bitcoin Core GUI since **v0.9.0** ([PR #5216](https://github.com/bitcoin/bitcoin/pull/5216)). Support can be optionally disabled at build time since **v0.18.0** ([PR 14451](https://github.com/bitcoin/bitcoin/pull/14451)). +* [`BIP 70`](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) [`71`](https://github.com/bitcoin/bips/blob/master/bip-0071.mediawiki) [`72`](https://github.com/bitcoin/bips/blob/master/bip-0072.mediawiki): Payment Protocol support has been available in Bitcoin Core GUI since **v0.9.0** ([PR #5216](https://github.com/bitcoin/bitcoin/pull/5216)). Support can be optionally disabled at build time since **v0.18.0** ([PR 14451](https://github.com/bitcoin/bitcoin/pull/14451)), and is disabled by default at build time since **v0.19.0** ([PR #15584](https://github.com/bitcoin/bitcoin/pull/15584)). * [`BIP 90`](https://github.com/bitcoin/bips/blob/master/bip-0090.mediawiki): Trigger mechanism for activation of BIPs 34, 65, and 66 has been simplified to block height checks since **v0.14.0** ([PR #8391](https://github.com/bitcoin/bitcoin/pull/8391)). * [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, and enforced for all peer versions as of **v0.13.0** ([PR #6579](https://github.com/bitcoin/bitcoin/pull/6579) and [PR #6641](https://github.com/bitcoin/bitcoin/pull/6641)). * [`BIP 112`](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki): The CHECKSEQUENCEVERIFY opcode has been implemented since **v0.12.1** ([PR #7524](https://github.com/bitcoin/bitcoin/pull/7524)) and has been activated since *block 419328*. * [`BIP 113`](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki): Median time past lock-time calculations have been implemented since **v0.12.1** ([PR #6566](https://github.com/bitcoin/bitcoin/pull/6566)) and have been activated since *block 419328*. -* [`BIP 125`](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee signaling honoured in mempool and mining as of **v0.12.0** ([PR 6871](https://github.com/bitcoin/bitcoin/pull/6871)). +* [`BIP 125`](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee signaling honoured in mempool and mining as of **v0.12.0** ([PR 6871](https://github.com/bitcoin/bitcoin/pull/6871)). Enabled by default in the wallet GUI as of **v0.18.1** ([PR #11605](https://github.com/bitcoin/bitcoin/pull/11605)) * [`BIP 130`](https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki): direct headers announcement is negotiated with peer versions `>=70012` as of **v0.12.0** ([PR 6494](https://github.com/bitcoin/bitcoin/pull/6494)). * [`BIP 133`](https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki): feefilter messages are respected and sent for peer versions `>=70013` as of **v0.13.0** ([PR 7542](https://github.com/bitcoin/bitcoin/pull/7542)). * [`BIP 141`](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki): Segregated Witness (Consensus Layer) as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)), and defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)). @@ -33,6 +33,7 @@ BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.18.0**): * [`BIP 145`](https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki): getblocktemplate updates for Segregated Witness as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)). * [`BIP 147`](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki): NULLDUMMY softfork as of **v0.13.1** ([PR 8636](https://github.com/bitcoin/bitcoin/pull/8636) and [PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)). * [`BIP 152`](https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki): Compact block transfer and related optimizations are used as of **v0.13.0** ([PR 8068](https://github.com/bitcoin/bitcoin/pull/8068)). +- [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients can be indexed as of **v0.19.0** ([PR #14121](https://github.com/bitcoin/bitcoin/pull/14121)). * [`BIP 159`](https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki): The NODE_NETWORK_LIMITED service bit is signalled as of **v0.16.0** ([PR 11740](https://github.com/bitcoin/bitcoin/pull/11740)), and such nodes are connected to as of **v0.17.0** ([PR 10387](https://github.com/bitcoin/bitcoin/pull/10387)). * [`BIP 173`](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki): Bech32 addresses for native Segregated Witness outputs are supported as of **v0.16.0** ([PR 11167](https://github.com/bitcoin/bitcoin/pull/11167)). * [`BIP 174`](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki): RPCs to operate on Partially Signed Bitcoin Transactions (PSBT) are present as of **v0.17.0** ([PR 13557](https://github.com/bitcoin/bitcoin/pull/13557)). diff --git a/doc/release-notes-15584.md b/doc/release-notes-15584.md deleted file mode 100644 index 3d9b1cc903..0000000000 --- a/doc/release-notes-15584.md +++ /dev/null @@ -1,4 +0,0 @@ -GUI Changes ------------ -- In 0.18.0 a `./configure` flag was introduced to allow disabling BIP70 support in the GUI (support was enabled by default). In 0.19.0 this flag is now __disabled__ by default. -- If you want compile Bitcoin Core with BIP70 support in the GUI, you can pass `--enable-bip70` to `./configure`.
\ No newline at end of file diff --git a/doc/release-notes-16185.md b/doc/release-notes-16185.md deleted file mode 100644 index 2567ebea40..0000000000 --- a/doc/release-notes-16185.md +++ /dev/null @@ -1,6 +0,0 @@ -RPC changes ------------ -The `gettransaction` RPC now accepts a third (boolean) argument `verbose`. If -set to `true`, a new `decoded` field will be added to the response containing -the decoded transaction. This field is equivalent to RPC `decoderawtransaction`, -or RPC `getrawtransaction` when `verbose` is passed. diff --git a/doc/release-notes-16512.md b/doc/release-notes-16512.md deleted file mode 100644 index 9aa9cf36f9..0000000000 --- a/doc/release-notes-16512.md +++ /dev/null @@ -1,4 +0,0 @@ -RPC changes ------------ -The RPC `joinpsbts` will shuffle the order of the inputs and outputs of the resulting joined psbt. -Previously inputs and outputs were added in the order that the PSBTs were provided which makes correlating inputs to outputs extremely easy. diff --git a/doc/release-notes-16695.md b/doc/release-notes-16695.md deleted file mode 100644 index 7acf1dcf97..0000000000 --- a/doc/release-notes-16695.md +++ /dev/null @@ -1,5 +0,0 @@ -Updated RPCs ------------- - -- The `getchaintxstats` RPC now returns the additional key of - `window_final_block_height`. diff --git a/doc/release-notes-16787.md b/doc/release-notes-16787.md deleted file mode 100644 index c42b7a5803..0000000000 --- a/doc/release-notes-16787.md +++ /dev/null @@ -1,3 +0,0 @@ -RPC changes ------------ -The `getnetworkinfo` and `getpeerinfo` commands now contain a new field with decoded network service flags. diff --git a/doc/release-notes.md b/doc/release-notes.md index 04aab56a72..71dc40e66c 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -132,6 +132,10 @@ Low-level Changes section below. would risk using up the "wrong" UTXO for an address reuse case. (#13756) +- RPCs which have an `include_watchonly` argument or `includeWatching` option now default to `true` for watch-only + wallets. Affected RPCs are: `getbalance`, `listreceivedbyaddress`, `listreceivedbylabel`, `listtransactions`, + `listsinceblock`, `gettransaction`, `walletcreatefundedpsbt`, and `fundrawtransaction`. (#16383) + - `listunspent` now returns a "reused" bool for each output if the wallet flag "avoid_reuse" is enabled. (#13756) @@ -164,19 +168,32 @@ Low-level Changes section below. progress of the wallet's scanning historical blocks for transactions affecting its balances. (#15730) +- `gettransaction` now accepts a third (boolean) argument `verbose`. If + set to `true`, a new `decoded` field will be added to the response containing + the decoded transaction. This field is equivalent to RPC `decoderawtransaction`, + or RPC `getrawtransaction` when `verbose` is passed. + - `createwallet` accepts a new `passphrase` parameter. If set, this will create the new wallet encrypted with the given passphrase. If unset (the default) or set to an empty string, no encryption will be used. (#16394) +- `getchaintxstats` RPC now returns the additional key of + `window_final_block_height`. + - `getmempoolentry` now provides a `weight` field containing the transaction weight as defined in BIP141. (#16647) +- The `getnetworkinfo` and `getpeerinfo` commands now contain a new field with decoded network service flags. + - `getdescriptorinfo` now returns an additional `checksum` field containing the checksum for the unmodified descriptor provided by the user (that is, before the descriptor is normalized for the `descriptor` field). (#15986) +- `joinpsbts` will shuffle the order of the inputs and outputs of the resulting joined psbt. + Previously inputs and outputs were added in the order that the PSBTs were provided which makes correlating inputs to outputs extremely easy. + - `walletcreatefundedpsbt` now signals BIP125 Replace-by-Fee if the `-walletrbf` configuration option is set to true. (#15911) @@ -188,6 +205,9 @@ GUI changes type may be changed by the `-addresstype` configuration option. (#15711, #16497) +- In 0.18.0 a `./configure` flag was introduced to allow disabling BIP70 support in the GUI (support was enabled by default). In 0.19.0 this flag is now __disabled__ by default. +- If you want compile Bitcoin Core with BIP70 support in the GUI, you can pass `--enable-bip70` to `./configure`. + Deprecated or removed configuration options ------------------------------------------- @@ -273,7 +293,7 @@ Configuration ------------ - A setting specified in the default section but not also specified in a - network-specific section (e.g. testnet) will now produce a error + network-specific section (e.g. testnet) will now produce an error preventing startup instead of just a warning unless the network is mainnet. This prevents settings intended for mainnet from being applied to testnet or regtest. (#15629) diff --git a/doc/release-process.md b/doc/release-process.md index 7eb8002c6c..551bde78a3 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -11,7 +11,7 @@ Release Process ### Before every major and minor release -* Update [bips.md](bips.md) to account for changes since the last release. +* Update [bips.md](bips.md) to account for changes since the last release (don't forget to bump the version number on the first line). * Update version in `configure.ac` (don't forget to set `CLIENT_VERSION_RC` to `0`). * Write release notes (see "Write the release notes" below). * Update `src/chainparams.cpp` nMinimumChainWork with information from the getblockchaininfo rpc. @@ -26,7 +26,7 @@ Release Process * Update hardcoded [seeds](/contrib/seeds/README.md), see [this pull request](https://github.com/bitcoin/bitcoin/pull/7415) for an example. * Update [`src/chainparams.cpp`](/src/chainparams.cpp) m_assumed_blockchain_size and m_assumed_chain_state_size with the current size plus some overhead (see [this](#how-to-calculate-m_assumed_blockchain_size-and-m_assumed_chain_state_size) for information on how to calculate them). * Update `src/chainparams.cpp` chainTxData with statistics about the transaction count and rate. Use the output of the RPC `getchaintxstats`, see - [this pull request](https://github.com/bitcoin/bitcoin/pull/12270) for an example. Reviewers can verify the results by running `getchaintxstats <window_block_count> <window_last_block_hash>` with the `window_block_count` and `window_last_block_hash` from your output. + [this pull request](https://github.com/bitcoin/bitcoin/pull/17002) for an example. Reviewers can verify the results by running `getchaintxstats <window_block_count> <window_last_block_hash>` with the `window_block_count` and `window_last_block_hash` from your output. * On both the master branch and the new release branch: - update `CLIENT_VERSION_MINOR` in [`configure.ac`](../configure.ac) - update `CLIENT_VERSION_MINOR`, `PACKAGE_VERSION`, and `PACKAGE_STRING` in [`build_msvc/bitcoin_config.h`](/build_msvc/bitcoin_config.h) @@ -378,7 +378,7 @@ Both variables are used as a guideline for how much space the user needs on thei Note that all values should be taken from a **fully synced** node and have an overhead of 5-10% added on top of its base value. To calculate `m_assumed_blockchain_size`: -- For `mainnet` -> Take the size of the Bitcoin data directory, excluding `/regtest` and `/testnet3` directories. +- For `mainnet` -> Take the size of the data directory, excluding `/regtest` and `/testnet3` directories. - For `testnet` -> Take the size of the `/testnet3` directory. diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 5964877eb8..7ff30ac1cd 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -84,10 +84,10 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008 // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000051dc8b82f450202ecb3d471"); + consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000008ea3cf107ae0dec57f03fe8"); // By default assume that the signatures in ancestors of this block are valid. - consensus.defaultAssumeValid = uint256S("0x0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee"); //563378 + consensus.defaultAssumeValid = uint256S("0x00000000000000000005f8920febd3925f8272a6a71237563d78c2edfdd09ddf"); // 597379 /** * The message start string is designed to be unlikely to occur in normal data. @@ -100,8 +100,8 @@ public: pchMessageStart[3] = 0xd9; nDefaultPort = 8333; nPruneAfterHeight = 100000; - m_assumed_blockchain_size = 240; - m_assumed_chain_state_size = 3; + m_assumed_blockchain_size = 280; + m_assumed_chain_state_size = 4; genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); @@ -155,10 +155,10 @@ public: }; chainTxData = ChainTxData{ - // Data from rpc: getchaintxstats 4096 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee - /* nTime */ 1550374134, - /* nTxCount */ 383732546, - /* dTxRate */ 3.685496590998308 + // Data from RPC: getchaintxstats 4096 00000000000000000005f8920febd3925f8272a6a71237563d78c2edfdd09ddf + /* nTime */ 1569926786, + /* nTxCount */ 460596047, + /* dTxRate */ 3.77848885073875, }; } }; @@ -191,10 +191,10 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008 // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000007dbe94253893cbd463"); + consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000012b2a3a62424f21c918"); // By default assume that the signatures in ancestors of this block are valid. - consensus.defaultAssumeValid = uint256S("0x0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75"); //1354312 + consensus.defaultAssumeValid = uint256S("0x00000000000000b7ab6ce61eb6d571003fbe5fe892da4c9b740c49a07542462d"); // 1580000 pchMessageStart[0] = 0x0b; pchMessageStart[1] = 0x11; @@ -240,10 +240,10 @@ public: }; chainTxData = ChainTxData{ - // Data from rpc: getchaintxstats 4096 0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75 - /* nTime */ 1531929919, - /* nTxCount */ 19438708, - /* dTxRate */ 0.626 + // Data from RPC: getchaintxstats 4096 00000000000000b7ab6ce61eb6d571003fbe5fe892da4c9b740c49a07542462d + /* nTime */ 1569741320, + /* nTxCount */ 52318009, + /* dTxRate */ 0.1517002392872353, }; } }; diff --git a/src/init.cpp b/src/init.cpp index 7c752d615a..8c0d599435 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -481,7 +481,7 @@ void SetupServerArgs() "and level 4 tries to reconnect the blocks, " "each level includes the checks of the previous levels " "(0-4, default: %u)", DEFAULT_CHECKLEVEL), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); - gArgs.AddArg("-checkblockindex", strprintf("Do a full consistency check for the block tree, setBlockIndexCandidates, ::ChainActive() and mapBlocksUnlinked occasionally. (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); + gArgs.AddArg("-checkblockindex", strprintf("Do a consistency check for the block tree, chainstate, and other validation data structures occasionally. (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-checkmempool=<n>", strprintf("Run checks every <n> transactions (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-checkpoints", strprintf("Disable expensive verification for known chain history (default: %u)", DEFAULT_CHECKPOINTS_ENABLED), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-deprecatedrpc=<method>", "Allows deprecated RPC method(s) to be used", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 46f8deee57..ec6075c8fb 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -436,9 +436,6 @@ int GuiMain(int argc, char* argv[]) #if QT_VERSION >= 0x050600 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif -#ifdef Q_OS_MAC - QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); -#endif BitcoinApplication app(*node); diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp index 11a518ebd2..4fe440a679 100644 --- a/src/qt/test/addressbooktests.cpp +++ b/src/qt/test/addressbooktests.cpp @@ -146,7 +146,7 @@ void AddressBookTests::addressBookTests() // and fails to handle returned nulls // (https://bugreports.qt.io/browse/QTBUG-49686). QWARN("Skipping AddressBookTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke " - "with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build."); + "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build."); return; } #endif diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp index 8ae01ac093..e730c8f6d5 100644 --- a/src/qt/test/apptests.cpp +++ b/src/qt/test/apptests.cpp @@ -57,7 +57,7 @@ void AppTests::appTests() // and fails to handle returned nulls // (https://bugreports.qt.io/browse/QTBUG-49686). QWARN("Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke " - "with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build."); + "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build."); return; } #endif diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 796cf24b36..c39266a397 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -61,9 +61,9 @@ int main(int argc, char *argv[]) // platform ("xcb", "windows", or "cocoa") so tests can't unintentionally // interfere with any background GUIs and don't require extra resources. #if defined(WIN32) - _putenv_s("QT_QPA_PLATFORM", "minimal"); + if (getenv("QT_QPA_PLATFORM") == nullptr) _putenv_s("QT_QPA_PLATFORM", "minimal"); #else - setenv("QT_QPA_PLATFORM", "minimal", 0); + setenv("QT_QPA_PLATFORM", "minimal", /* overwrite */ 0); #endif // Don't remove this, it's needed to access diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index 120dff95c0..eea874c0d4 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -123,9 +123,9 @@ void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, st // // This also requires overriding the default minimal Qt platform: // -// src/qt/test/test_bitcoin-qt -platform xcb # Linux -// src/qt/test/test_bitcoin-qt -platform windows # Windows -// src/qt/test/test_bitcoin-qt -platform cocoa # macOS +// QT_QPA_PLATFORM=xcb src/qt/test/test_bitcoin-qt # Linux +// QT_QPA_PLATFORM=windows src/qt/test/test_bitcoin-qt # Windows +// QT_QPA_PLATFORM=cocoa src/qt/test/test_bitcoin-qt # macOS void TestGUI() { // Set up wallet and chain with 105 blocks (5 mature blocks for spending). @@ -256,7 +256,7 @@ void WalletTests::walletTests() // and fails to handle returned nulls // (https://bugreports.qt.io/browse/QTBUG-49686). QWARN("Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke " - "with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build."); + "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build."); return; } #endif diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index ebe7925368..648fdb7673 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -49,6 +49,36 @@ QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const i } } +#ifndef ENABLE_BIP70 +// Takes an encoded PaymentRequest as a string and tries to find the Common Name of the X.509 certificate +// used to sign the PaymentRequest. +bool GetPaymentRequestMerchant(const std::string& pr, QString& merchant) +{ + // Search for the supported pki type strings + if (pr.find(std::string({0x12, 0x0b}) + "x509+sha256") != std::string::npos || pr.find(std::string({0x12, 0x09}) + "x509+sha1") != std::string::npos) { + // We want the common name of the Subject of the cert. This should be the second occurrence + // of the bytes 0x0603550403. The first occurrence of those is the common name of the issuer. + // After those bytes will be either 0x13 or 0x0C, then length, then either the ascii or utf8 + // string with the common name which is the merchant name + size_t cn_pos = pr.find({0x06, 0x03, 0x55, 0x04, 0x03}); + if (cn_pos != std::string::npos) { + cn_pos = pr.find({0x06, 0x03, 0x55, 0x04, 0x03}, cn_pos + 5); + if (cn_pos != std::string::npos) { + cn_pos += 5; + if (pr[cn_pos] == 0x13 || pr[cn_pos] == 0x0c) { + cn_pos++; // Consume the type + int str_len = pr[cn_pos]; + cn_pos++; // Consume the string length + merchant = QString::fromUtf8(pr.data() + cn_pos, str_len); + return true; + } + } + } + } + return false; +} +#endif + QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit) { int numBlocks; @@ -255,26 +285,34 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>"; // Message from normal bitcoin:URI (bitcoin:123...?message=example) - for (const std::pair<std::string, std::string>& r : orderForm) + for (const std::pair<std::string, std::string>& r : orderForm) { if (r.first == "Message") strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(r.second, true) + "<br>"; -#ifdef ENABLE_BIP70 - // - // PaymentRequest info: - // - for (const std::pair<std::string, std::string>& r : orderForm) - { + // + // PaymentRequest info: + // if (r.first == "PaymentRequest") { + QString merchant; +#ifdef ENABLE_BIP70 PaymentRequestPlus req; req.parse(QByteArray::fromRawData(r.second.data(), r.second.size())); - QString merchant; - if (req.getMerchant(PaymentServer::getCertStore(), merchant)) + if (!req.getMerchant(PaymentServer::getCertStore(), merchant)) { + merchant.clear(); + } +#else + if (!GetPaymentRequestMerchant(r.second, merchant)) { + merchant.clear(); + } else { + merchant += tr(" (Certificate was not verified)"); + } +#endif + if (!merchant.isNull()) { strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>"; + } } } -#endif if (wtx.is_coinbase) { diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 13481af9c5..0ed92e8d5b 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -244,6 +244,7 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato return sigdata.complete; } +namespace { class SignatureExtractorChecker final : public BaseSignatureChecker { private: @@ -252,21 +253,17 @@ private: public: SignatureExtractorChecker(SignatureData& sigdata, BaseSignatureChecker& checker) : sigdata(sigdata), checker(checker) {} - bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const override; -}; - -bool SignatureExtractorChecker::CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const -{ - if (checker.CheckSig(scriptSig, vchPubKey, scriptCode, sigversion)) { - CPubKey pubkey(vchPubKey); - sigdata.signatures.emplace(pubkey.GetID(), SigPair(pubkey, scriptSig)); - return true; + bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const override + { + if (checker.CheckSig(scriptSig, vchPubKey, scriptCode, sigversion)) { + CPubKey pubkey(vchPubKey); + sigdata.signatures.emplace(pubkey.GetID(), SigPair(pubkey, scriptSig)); + return true; + } + return false; } - return false; -} +}; -namespace -{ struct Stacks { std::vector<valtype> script; diff --git a/src/util/threadnames.cpp b/src/util/threadnames.cpp index b221b0c975..c25e9ed661 100644 --- a/src/util/threadnames.cpp +++ b/src/util/threadnames.cpp @@ -57,6 +57,6 @@ static void SetInternalName(std::string name) { } void util::ThreadRename(std::string&& name) { - SetThreadName(("bitcoin-" + name).c_str()); + SetThreadName(("b-" + name).c_str()); SetInternalName(std::move(name)); } diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index b2017bc18e..615f9abbe0 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -33,7 +33,7 @@ def assert_net_servicesnames(servicesflag, servicenames): `getpeerinfo` and `getnetworkinfo`. :param servicesflag: The services as an integer. - :param servicesnames: The list of decoded services names, as strings. + :param servicenames: The list of decoded services names, as strings. """ servicesflag_generated = 0 for servicename in servicenames: |