aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-23Use SelectCoinsSRD if it has less wasteAndrew Chow
Try to find a solution with SelectCoinsSRD. If we do have one, add it to the list of solutions from which we choose the one with the least waste as the solution to use.
2021-09-23Add SelectCoinsSRD functionAndrew Chow
2021-09-23tests: wallet_basic lock needed unspentsAndrew Chow
To avoid accidentally spending UTXOs that are needed later in the test, lock those UTXOs after they're creation.
2021-09-23tests: wallet_txn explicilty specify inputsAndrew Chow
Instead of relying on coin selection to deterministically choose the correct inputs to use, just specify them explicitly and use the raw transaction RPCs.
2021-09-23tests: rpc_fundrawtx better test for UTXO inclusion with include_unsafeAndrew Chow
Don't assume that specific inputs are going to be used when they aren't specified explicitly. Also fixes a bug in the include_unsafe test where after the inputs confirm, include_unsafe should be set to False rather than True.
2021-09-09tests: rpc_fundrawtx use specific inputs for unavailable change testAndrew Chow
For the test that checks that there is no error when change is unavailable but change is also not needed, use specific UTXOs so that SRD does not cause this to fail when it chooses random inputs.
2021-09-09tests: rpc_fundrawtx lock to UTXO typesAndrew Chow
For some of the tests within rpc_fundrawtx, there is the expectation that two independent calls to coin selection RPCs will use the same type of UTXO. This is not necessarily guaranteed, so to make sure it is, use lockunspent prior to those tests.
2021-09-09Merge bitcoin/bitcoin#22904: sync, log: inline lock contention logging macro ↵merge-script
to fix duration, improve BCLog::LogMsg() f530202353a4f8bb444966559aa15681ab3cebc6 Make unexpected time type in BCLog::LogMsg() a compile-time error (Martin Ankerl) bddae7e7ff7bb5931ed807acaef7336f2ee98476 Add util/types.h with ALWAYS_FALSE template (MarcoFalke) 498b323425d960274c40472a6a847afc1982201d log, timer: improve BCLog::LogMsg() (Jon Atack) 8d2f847ed913f15677ae978a412015ac844ffceb sync: inline lock contention logging macro to fix time duration (Jon Atack) Pull request description: Follow-up to #22736. The first commit addresses the issue identified and reported by Martin Ankerl in https://github.com/bitcoin/bitcoin/pull/22736#discussion_r703019629 to fix the lock contention duration reporting. The next three commits make improvements to the timer code in `BCLog::LogMsg()` and add `util/types.h` with an `ALWAYS_FALSE` template, that springboard from https://github.com/bitcoin/bitcoin/pull/22736#discussion_r702747920 by Marco Falke. ACKs for top commit: martinus: re-ACK f530202353a4f8bb444966559aa15681ab3cebc6. I ran a fully synced node for about a day. My node was mostly idle though so not much was going on. I [wrote a little script](https://github.com/martinus/bitcoin-stuff/blob/main/scripts/parse-debuglog-contention-single.rb) to parse the `debug.log` and summarize the output to see if anything interesting was going on, here is the result: theStack: ACK f530202353a4f8bb444966559aa15681ab3cebc6 Tree-SHA512: 37d093eac5590e1b5846ab5994d0950d71e131177d1afe4a5f7fcd614270f977e0ea117e7af788e9a74ddcccab35b42ec8fa4db3a3378940d4988df7d21cdaaa
2021-09-09Merge bitcoin/bitcoin#22914: util: remove libevent <= 2.0.18 back-compat codefanquake
6045a1464252075f4135bd4a69d202d55d124eb2 util: remove libevent <= 2.0.18 back-compat code (fanquake) Pull request description: Now that we require libevent >=2.0.21, remove backwards compatibility code for older versions. ACKs for top commit: kristapsk: ACK 6045a1464252075f4135bd4a69d202d55d124eb2 Tree-SHA512: 49a237ee3cef78b105f8ea91dc3e541fe700fe3a3d02a88f85ec91772068ffbe508dbe196a4d693399b2bcf903251b9bc2573f04cb8f2e21a2ea481f35bfde32
2021-09-09Merge bitcoin/bitcoin#22923: test: Switch multiprocess to clang i686 buildW. J. van der Laan
fa309ee61c09726a8780acaea94502712f817921 bench: Fix 32-bit compilation failure in addrman bench (MarcoFalke) fae0295a799499268caca9c385ac4d7061543980 ci: Switch multiprocess to i686 build (MarcoFalke) Pull request description: Building for i686 with clang helps to catch bugs early for: * The OSS-Fuzz i686 clang libFuzzer build * The arm 32-bit native clang build Fixes #22889 ACKs for top commit: hebasto: ACK fa309ee61c09726a8780acaea94502712f817921 Tree-SHA512: 581820d319aae2fcd4dd44979ee3d4164a575f0438476890aa2a7447f1392a5da26766cd6ab954530499b54f66eec2417bdeefdd7efb19bc27dd679cd2b9d0ce
2021-09-09Merge bitcoin/bitcoin#22582: test: a test to check descendant limitsmerge-script
fa7db1cbf7e8400b625fccd5757f8e1b200796bd [test] checks descendants limtis for second generation Package descendants (ritickgoenka) Pull request description: This PR adds a new functional test to test the new descendant limits for packages that were proposed in #21800. ``` +----------------------+ | | | M1 | | ^ ^ | | M2 ^ | | . ^ | | . ^ | | . ^ | | . ^ | | M24 ^ | | ^ | | P1 | | ^ | | P2 | | | +----------------------+ ``` This test is for checking a transaction to fail its descendant count limits because of a combination of mempool descendants, package direct descendants, and package indirect descendants. In this test, P1 has M1 as a mempool ancestor, P2 has no in-mempool ancestors, but when combined P2 has M1 as an ancestor and M1 exceeds descendant_limits (23 in-mempool descendants + 2 in-package descendants, a total of 26 including itself) ACKs for top commit: ryanofsky: Code review ACK fa7db1cbf7e8400b625fccd5757f8e1b200796bd. Only were suggested changes since last review: simplifying test and dropping P3 transaction as John suggested, and adding assert_equal I suggested glozow: ACK fa7db1cbf7e8400b625fccd5757f8e1b200796bd jnewbery: ACK fa7db1cbf7 Tree-SHA512: d1eb993550ac8ce31cbe42e17c6522a213ede66970d5d9391f31a116477ab5889fefa6ff2df6ceadd63a28c1be1ad893b0e8e449247e9ade2ca61dc636508d68
2021-09-09util: remove libevent <= 2.0.18 back-compat codefanquake
Now that we require libevent >=2.0.21, remove backwards compatibility code for older versions.
2021-09-09Merge bitcoin/bitcoin#22079: zmq: Add support to listen on IPv6 addressesW. J. van der Laan
e6998838e5548991274ad2bf1697d862905b8837 doc: Add IPv6 address to zmq example (nthumann) 8abe5703a9bb76bc92204a6f69775790e96208fa test: Add IPv6 test to zmq (nthumann) ded449b726e47f35798ef1c4b1e59123a0dc2b61 zmq: Enable IPv6 on listening socket (nthumann) Pull request description: This PR adds support for listening on IPv6 addresses with bitcoinds ZMQ interface, just like the RPC server. Currently, it is not possible to specify an IPv6 address, as the `ZMQ_IPV6` [socket option](http://api.zeromq.org/master:zmq-setsockopt#toc27) is not set and therefore the ZMQ initialization fails, if one does so. The absence of this option has also been noted [here](https://github.com/bitcoin/bitcoin/issues/15198#issuecomment-617378512). With this PR one can e.g. set `-zmqpubhashblock=tcp://[::1]:28333` to listen on the IPv6 loopback address. ACKs for top commit: laanwj: Code review ACK e6998838e5548991274ad2bf1697d862905b8837 theStack: Tested ACK e6998838e5548991274ad2bf1697d862905b8837 🌱 Tree-SHA512: 43c3043d8d5c79794d475926259c1be975b694db4fcc1f7750a9a28e242f0fa1b531735a63ea5777498003aa5834f6243f39742d0f3941f2f37593d0c7890700
2021-09-09Merge bitcoin/bitcoin#22788: scripted-diff: Use generate* from TestFrameworkmerge-script
fa0b916971e5bc23ad6396831940a2899ca05402 scripted-diff: Use generate* from TestFramework (MarcoFalke) Pull request description: This is needed for #22567. By using the newly added `generate*` member functions of the test framework, it paves the way to make it easier to implicitly call `sync_all` after block generation to avoid intermittent issues. ACKs for top commit: jonatack: ACK fa0b916971e5bc23ad6396831940a2899ca05402 Tree-SHA512: e74a324b60250a87c08847cdfd7b6ce3e1d89b891659fd168f6dd7dc0aa718d0edd28285374a613f462f34f4ef8e12c90ad44fb58721c91b2ea691406ad22c2a
2021-09-09Merge bitcoin/bitcoin#22925: test: Add missing suppression ↵MarcoFalke
signed-integer-overflow:addrman.cpp facb534c37725ca446fd56d781b70ba26508bd2a test: Add missing suppression signed-integer-overflow:addrman.cpp (MarcoFalke) Pull request description: Steps to reproduce: [crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log](https://github.com/bitcoin/bitcoin/files/7130854/crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log) ``` $ FUZZ=addrman ./src/test/fuzz/fuzz ./crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log INFO: Running with entropic power schedule (0xFF, 100). INFO: Seed: 1257085025 INFO: Loaded 1 modules (379531 inline 8-bit counters): 379531 [0x562577b768a8, 0x562577bd3333), INFO: Loaded 1 PC tables (379531 PCs): 379531 [0x562577bd3338,0x56257819dbe8), ./src/test/fuzz/fuzz: Running 1 inputs 1 time(s) each. Running: ./crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log addrman.cpp:80:14: runtime error: signed integer overflow: 2105390 - -9223372036854775808 cannot be represented in type 'long' #0 0x5625752f0179 in CAddrInfo::IsTerrible(long) const addrman.cpp:80:14 #1 0x56257531917d in CAddrMan::GetAddr_(std::vector<CAddress, std::allocator<CAddress> >&, unsigned long, unsigned long, std::optional<Network>) const addrman.cpp:874:16 #2 0x562574f0251b in CAddrMan::GetAddr(unsigned long, unsigned long, std::optional<Network>) const ./addrman.h:259:9 #3 0x562574eff7ad in addrman_fuzz_target(Span<unsigned char const>) test/fuzz/addrman.cpp:295:26 SUMMARY: UndefinedBehaviorSanitizer: signed-integer-overflow addrman.cpp:80:14 in ACKs for top commit: practicalswift: cr ACK facb534c37725ca446fd56d781b70ba26508bd2a Tree-SHA512: 6368c48be8762c793f760d86caaf37a10caffa08f6903f3667dd08f7f67fade10f385fbffc451ddcbeeecc9fd02526ed97ab9de13398a75fffa55976a99af6b9
2021-09-09Merge bitcoin/bitcoin#22912: ci: Fix merge_script in MSVC taskfanquake
f78cc90524dc15c8981da2a480621c2e47e3c7dd ci: Fix merge_script in MSVC task (Hennadii Stepanov) Pull request description: The new `merge_script` in the MSVC build task does not really exit early when the task is triggered by a non-pr. In the current code https://github.com/bitcoin/bitcoin/blob/e4aa9b15b9f80a08076ad329b473fe9107d9e65e/.cirrus.yml#L104 the `exit 0` command exits from the PowerShell call, not the recent `merge_script`. This cause the next lines https://github.com/bitcoin/bitcoin/blob/e4aa9b15b9f80a08076ad329b473fe9107d9e65e/.cirrus.yml#L105-L107 are executed unconditionally. Here is an excerpt from [CI task log](https://api.cirrus-ci.com/v1/task/4578647416766464/logs/merge.log) for the ["Merge #22915: Remove confusing CAddrDB " commit](https://github.com/bitcoin/bitcoin/commit/896649996bdaa80300fa20027a9789558233268d): ``` ... C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand ZwBpAHQAIAByAGUAcwBlAHQAIAAtAC0AaABhAHIAZAA= HEAD is now at 896649996 Merge bitcoin/bitcoin#22915: Remove confusing CAddrDB C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand aQBmACAAKAAkAGUAbgB2ADoAQwBJAFIAUgBVAFMAXwBQAFIAIAAtAGUAcQAgACQAbgB1AGwAbAApACAAewAgAGUAeABpAHQAIAAwADsAIAB9AA== C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand ZwBpAHQAIABmAGUAdABjAGgAIAAkAGUAbgB2ADoAQwBJAFIAUgBVAFMAXwBSAEUAUABPAF8AQwBMAE8ATgBFAF8AVQBSAEwAIAAkAGUAbgB2ADoAQwBJAFIAUgBVAFMAXwBCAEEAUwBFAF8AQgBSAEEATgBDAEgA From https://github.com/bitcoin/bitcoin * branch HEAD -> FETCH_HEAD C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand ZwBpAHQAIABtAGUAcgBnAGUAIABGAEUAVABDAEgAXwBIAEUAQQBEAA== Already up to date. C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 ``` This PR fixes this issue, and makes `merge_script` log more readable. ACKs for top commit: MarcoFalke: Concept ACK f78cc90524dc15c8981da2a480621c2e47e3c7dd Tree-SHA512: c88b115f99f9019a4100a10df051e32c05487612c13105d10873b9cf38965eeca731604d36610ae750cb1f93ba77ce97dca7599fe4984181210d0753be4eb9a0
2021-09-09bench: Fix 32-bit compilation failure in addrman benchMarcoFalke
2021-09-09Merge bitcoin/bitcoin#22922: ci: Fix and enable tests on WindowsMarcoFalke
fa0c194db34e776ddc68d8f585b7d66162c2617c cirrus: Enable tests on windows (MarcoFalke) fadecbd9a4d47957f42672911675c400caeaac24 test: Fix tests on Windows (MarcoFalke) Pull request description: Only a cherry-picked list. `--extended` can be enabled in a follow-up. ACKs for top commit: hebasto: ACK fa0c194db34e776ddc68d8f585b7d66162c2617c, tested locally on Windows 10 Pro 20H2 (build 19042.1165): Tree-SHA512: 47cfbcef7ce5fe0c62b77a1e45ace513c4f0109b1fcfaec94faf9e488fe9430d6ba0e852230021d432847eb1389a4e4b7cf39bf17f7b09bae36af3079e0d7399
2021-09-09Merge bitcoin/bitcoin#22915: Remove confusing CAddrDBMarcoFalke
fade9a1a4db71241ccad03fdacfb626453952963 Remove confusing CAddrDB (MarcoFalke) fa7f77b7d1709bf35808fced0d67b6e97b784d63 Fix addrdb includes (MarcoFalke) fa3f5d0dae2381038439b91ef2af85ec277c8294 Move addrman includes from .h to .cpp (MarcoFalke) Pull request description: Split out from #22762 to avoid having to carry it around in (an)other rebase(s) ACKs for top commit: ryanofsky: Code review ACK fade9a1a4db71241ccad03fdacfb626453952963 lsilva01: Code Review ACK https://github.com/bitcoin/bitcoin/pull/22915/commits/fade9a1a4db71241ccad03fdacfb626453952963 Tree-SHA512: 7615fb0b6235d0c1e6f8cd6263dd18c4d95890567c2b797fe6fce6cb12cc85ce6eacbe07dbb6d81b05d179ef03b42edfd61c940e35a1044ce6d363b54c2dae5c
2021-09-09Merge bitcoin/bitcoin#22390: system: skip trying to set the locale on NetBSDfanquake
fdd71448e78f442ffd93a3a3398a5062eaba9f1b system: skip trying to set the locale on NetBSD (fanquake) Pull request description: Just treat it the same as the other BSDs. Fixes #17379. ACKs for top commit: laanwj: Code review ACK fdd71448e78f442ffd93a3a3398a5062eaba9f1b practicalswift: cr ACK fdd71448e78f442ffd93a3a3398a5062eaba9f1b Tree-SHA512: 5fe0a66f014279ad2683b548692a36af493377fb92d1f28b15dc4feef871190fe08ef40dcc4f5ba21a525fe365c42fb429fe4be0673a1e96db163af587c23204
2021-09-09Merge bitcoin/bitcoin#22903: Enable clang-tidy bugprone-argument-comment and ↵fanquake
fix violations fa57fa1a2e764792b873998ddf38db2ac061dcb6 Enable clang-tidy bugprone-argument-comment and fix violations (MarcoFalke) Pull request description: Named arguments can be dangerous when they are wrong, because they are not enforced by the compiler. Currently there are only minor typos, no actual bugs. Fix the typos and add the `.clang-tidy` file to make it easier to find them in the future. ACKs for top commit: practicalswift: cr ACK fa57fa1a2e764792b873998ddf38db2ac061dcb6 fanquake: ACK fa57fa1a2e764792b873998ddf38db2ac061dcb6 Tree-SHA512: b66f01e0a1e77e56ed8454002176df660cc2cc0947a90785aa33cc5b8003a1f99fd8b2f8f89f2a0bf180ff2c42c031d69e669d127bb557b879c17975275a220b
2021-09-08cirrus: Enable tests on windowsMarcoFalke
2021-09-08ci: Switch multiprocess to i686 buildMarcoFalke
2021-09-08test: Add missing suppression signed-integer-overflow:addrman.cppMarcoFalke
2021-09-08test: Fix tests on WindowsMarcoFalke
2021-09-08Merge bitcoin/bitcoin#22916: doc: add missing copyright header to ↵MarcoFalke
getuniquepath.cpp 69a439b8807cb150068d196a0e2fd57fd80057df doc: add missing copyright header to getuniquepath.cpp (fanquake) Pull request description: This was missed in #21052. ACKs for top commit: hebasto: ACK 69a439b8807cb150068d196a0e2fd57fd80057df, but a scripted-diff using `copyright_header.py insert` looks preferable. Tree-SHA512: 1a75ffd93fa8e5e83821e1fe984353422740ebf9e203dc873debf4dffec0e23f55a1e31f806dd2d66087d3620f6dc447af69f9124f0bcc6676ef91ee35374832
2021-09-08doc: add missing copyright header to getuniquepath.cppfanquake
This was missed in #21052.
2021-09-08Merge bitcoin/bitcoin#22879: addrman: Fix format string in deserialize errorfanquake
fab0b55cf060c2b14fae5cee13f0a2dcaebde892 addrman: Fix format string in deserialize error (MarcoFalke) facce4ca44bc206b7656e297a7fa5dfb83a01012 test: Remove useless overwrite (MarcoFalke) Pull request description: The format string is evaluated differently on modern compilers (clang 10 and later, as well as gcc 10 and later). Work around the behaviour change in compilers by pinning the underlying type of the format arguments. Can be tested by observing a failing test when running against master compiled with clang 10 or gcc 10 (or later). ACKs for top commit: jonatack: ACK fab0b55cf060c2b14fae5cee13f0a2dcaebde892 verified the test fails on master as expected only at line 61 (assertion fixed by the code change); the last two test additions pass as expected mzumsande: ACK fab0b55cf060c2b14fae5cee13f0a2dcaebde892 Tree-SHA512: 07462901435107f3bc79098fd7d06446bfe8fe065fffdd35adfcba8f1dd3c499575006557afe7bc74b79d690c5ef7b58e3e031e908161be5529cf237e3b30609
2021-09-07ci: Fix merge_script in MSVC taskHennadii Stepanov
2021-09-07Make unexpected time type in BCLog::LogMsg() a compile-time errorMartin Ankerl
2021-09-07Add util/types.h with ALWAYS_FALSE templateMarcoFalke
2021-09-07Merge bitcoin/bitcoin#22899: ci: Build and cache static Qt instead of ↵MarcoFalke
downloading a pre-built one 3a68546fd0981e032005d3a5d2ca7b2ab9acc70b ci: Build and cache static Qt instead of downloading a pre-built one (Hennadii Stepanov) Pull request description: This PR makes the MSVC build CI task free of [pre-built static Qt binaries](https://github.com/sipsorcery/qt_win_binary/releases). It uses the approach which is documented in #22890. It takes about 13 minutes to build a static Qt dependency (for 8 CPUs): ![Screenshot from 2021-09-06 08-59-08](https://user-images.githubusercontent.com/32963518/132167857-bce49c74-f258-4468-b45b-75d0cf3c670c.png) with the maximum total time: ![Screenshot from 2021-09-06 08-59-26](https://user-images.githubusercontent.com/32963518/132167881-b84bd4de-38cc-4cb1-b9f7-35642cbea8cc.png) There is an additional benefit of this PR. It is no longer required to build a new static Qt package when a CI Windows image upgrades its building tools, and breaks the compatibility with the recent Qt package. ACKs for top commit: sipsorcery: utACK 3a68546fd0981e032005d3a5d2ca7b2ab9acc70b. Tree-SHA512: 2cf358ccecb26293b52c04158d6d3366ae6257cc3c04262e02234f7d7a03086885c67f0aad5702fcaa6f035fe4a09967a81245c561614875ecd2e90e2e00bbaa
2021-09-07ci: Build and cache static Qt instead of downloading a pre-built oneHennadii Stepanov
2021-09-07Merge bitcoin/bitcoin#22909: ci: Add missed comments and test_bitcoin.exe ↵MarcoFalke
command line option 64015eb01495689d8e02fb82c06eaa3f442ff6e5 ci: Add missed comments and test_bitcoin.exe command line option (Hennadii Stepanov) Pull request description: This PR is a #21551 follow up, and it: - adds missed comments, see https://github.com/bitcoin/bitcoin/pull/21551#discussion_r703342550 - restores missed `-l test_suite` command line option for `test_bitcoin.exe`, see https://github.com/bitcoin/bitcoin/pull/21551#discussion_r703348955 ACKs for top commit: MarcoFalke: cr ACK 64015eb01495689d8e02fb82c06eaa3f442ff6e5 Tree-SHA512: ad1c91544da39a94f033bc55ae5fdaf5774475702edd026635389e68d20e2608cb599dd51f3c1412e0287beef073352e48d9ec005c94df38cfe4fe2d21a94fe3
2021-09-07ci: Add missed comments and test_bitcoin.exe command line optionHennadii Stepanov
2021-09-07Merge bitcoin/bitcoin#21551: ci: Move Windows MSVC build from AppVeyor to CirrusMarcoFalke
97292b19140db32c6d85d63b70382e7bf60a55c4 ci: Drop AppVeyor CI integration (Hennadii Stepanov) 1fb70793b237b9a3a00ff744739e512dd7755937 ci: Add Windows task to Cirrus CI (Hennadii Stepanov) Pull request description: This PR: - gets rid off unreliable AppVeyor CI - places all CI configs in one place - allows to enable functional tests in the future (using a persistent worker) | no populated `vcpkg` cache | populated `vcpkg` cache | |---|---| | ![Screenshot from 2021-09-02 15-47-04](https://user-images.githubusercontent.com/32963518/131846156-9367bffc-9093-40ca-98c3-15db74e24113.png) | ![Screenshot from 2021-09-02 14-06-26](https://user-images.githubusercontent.com/32963518/131833053-a501454d-eecf-463c-a3a4-b89d2a494058.png) | Currently, AppVeyor builds take about 44..48 minutes. ACKs for top commit: sipsorcery: re-ACK 97292b19140db32c6d85d63b70382e7bf60a55c4. Tree-SHA512: 3af50d9fd68eb12f39724810dacf948e4068573b5dfd0dbaeb05d19d4bd6f10bd9a432656dcc32b742684b438d31305eace85c602296d7a1bf84b2f1fcc06f02
2021-09-07Remove confusing CAddrDBMarcoFalke
The class only stores the file path, reading it from a global. Globals are confusing and make testing harder. The method reading from a stream does not even use any class members, so putting it in a class is also confusing.
2021-09-07Fix addrdb includesMarcoFalke
2021-09-07Move addrman includes from .h to .cppMarcoFalke
This is a follow-up to the code move in commit a820e79512b67b1bfda20bdc32b47086d2b0910d
2021-09-07Merge bitcoin/bitcoin#19833: wallet: Avoid locking cs_wallet recursivelyMarcoFalke
5fabde6fadd1b07e981c97f5087d67c4179340ba wallet: AddWalletDescriptor requires cs_wallet lock (João Barbosa) 32d036e8dab5f5b24096d9765236441e7b6a3b34 wallet: GetLabelAddresses requires cs_wallet lock (João Barbosa) Pull request description: This is another small change towards non recursive wallet lock. ACKs for top commit: hebasto: ACK 5fabde6fadd1b07e981c97f5087d67c4179340ba, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 00506f0159c56854a171e58a451db8dd9b9f735039697b1cf2ca7f54de61fb51cc1e5eff42265233e041b4b1bfd29c2247496dc4456578e1a23c323bdec2901b
2021-09-07Enable clang-tidy bugprone-argument-comment and fix violationsMarcoFalke
2021-09-07Merge bitcoin-core/gui#398: refactor: Pass WalletModel object to the ↵Hennadii Stepanov
WalletView constructor d319c4dae9ed7d59d71b926e677707fce4194d0c qt, refactor: Replace WalletFrame::addWallet with WalletFrame::addView (Hennadii Stepanov) 92ddc02a16a74e10f24190929f05e2dcf2b55871 qt, refactor: Declare getWalletModel with const and noexcept qualifiers (Hennadii Stepanov) ca0e680bdcaa816c53355777d788a4c8478bb117 qt, refactor: Drop redundant checks of walletModel (Hennadii Stepanov) 404373bc6ac0589e9e28690c9d09114d626a3dc3 qt, refactor: Pass WalletModel object to WalletView constructor (Hennadii Stepanov) Pull request description: An instance of the `WalletView` class without the `walletModel` data member being set is invalid. So, it is better to set it in the constructor. Establishing one more `WalletView` class's invariant in constructor: - allows to drop all of checks of the`walletModel` in member functions - makes reasoning about the code that uses instances of the `WalletView` class easier Possible follow ups could extend this approach to other classes, e.g., `OverviewPage`, `TransactionView`, `ReceiveCoinsDialog`, `SendCoinsDialog`, `AddressBookPage`. ACKs for top commit: ShaMan239: Code review ACK d319c4dae9ed7d59d71b926e677707fce4194d0c promag: Code review ACK d319c4dae9ed7d59d71b926e677707fce4194d0c. jarolrod: ACK d319c4dae9ed7d59d71b926e677707fce4194d0c Tree-SHA512: b0c61f82811bb5aba2738067b53dc9ea4439230d547ce5c8fd85c480d8d70ea15f9942dbf13842383acbce467fba1ab4e132e37c56b654b46ba897301a41066e
2021-09-07ci: Drop AppVeyor CI integrationHennadii Stepanov
2021-09-07ci: Add Windows task to Cirrus CIHennadii Stepanov
2021-09-07log, timer: improve BCLog::LogMsg()Jon Atack
- make timer code more homogeneous - replace division with multiplication - log if the time type is unexpected
2021-09-06sync: inline lock contention logging macro to fix time durationJon Atack
Co-authored-by: Martin Ankerl <martin.ankerl@gmail.com>
2021-09-06Merge bitcoin/bitcoin#22397: build: Fix macOS Apple Silicon build with ↵W. J. van der Laan
miniupnpc and libnatpmp 2445df4eb36ba0d90e1283f36e629e1cf69eeef7 build: Fix macOS Apple Silicon build with miniupnpc and libnatpmp (Hennadii Stepanov) Pull request description: On master (7a49fdc58115845ece3a9890bf9498bee6b559de) the `configure` script does not pick up Homebrew's `miniupnpc` and `libnatpmp` packages on macOS Apple Silicon: ``` % ./configure --with-miniupnpc ... checking for miniupnpc/miniupnpc.h... no checking for miniupnpc/upnpcommands.h... no checking for miniupnpc/upnperrors.h... no ... checking whether to build with support for UPnP... configure: error: "UPnP requested but cannot be built. Use --without-miniupnpc." ``` ``` % ./configure --with-natpmp ... checking for natpmp.h... no ... checking whether to build with support for NAT-PMP... configure: error: NAT-PMP requested but cannot be built. Use --without-natpmp ``` The preferred Homebrew [prefix for Apple Silicon](https://docs.brew.sh/Installation) is `/opt/homebrew`. Therefore, if we do not use `pkg-config` to detect packages, we should set the `CPPFLAGS` and `LDFLAGS` variables for them explicitly. ACKs for top commit: Zero-1729: re-tACK 2445df4eb36ba0d90e1283f36e629e1cf69eeef7 (re-tested on an M1 Machine running macOS 11.4). jarolrod: re-ACK 2445df4eb36ba0d90e1283f36e629e1cf69eeef7 Tree-SHA512: d623d26492f463812bf66ca519847ff4b23d517466b6c51c3caf3642a582d02e5f03ce57915742b29f01bf9bceb731a3978ef9a5fdc82e568bcb62548eda758a
2021-09-06Merge bitcoin/bitcoin#21930: doc: update enumerator naming in developer notesMarcoFalke
77f37f58ad2f349cecb2eda28b415267d3d7d76e doc: update enum naming in developer notes (Jon Atack) Pull request description: Per our current doc, the general rule is we follow the C++ Core Guidelines, which for enumerator naming stipulate: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Renum-caps ``` Don’t use ALL_CAPS for enumerators Reason: Avoid clashes with macros. ``` but our examples (and often, codebase) are contradictory to it (and perhaps to common usage), which can be confusing when a contributor needs to choose a style to use. This patch: - updates the enumerator examples to snake_case per CPP Core Guidelines - clarifies for contributors that in this project enumerators may be snake_case, PascalCase or ALL_CAPS, and to use what seems appropriate. ACKs for top commit: practicalswift: cr ACK 77f37f58ad2f349cecb2eda28b415267d3d7d76e ryanofsky: ACK 77f37f58ad2f349cecb2eda28b415267d3d7d76e. I think this is good because it modernizes the example and clarifies current conventions. promag: ACK 77f37f58ad2f349cecb2eda28b415267d3d7d76e. Tree-SHA512: 7facc607fe5e1abab0f635864340143f13c2e4bb074eb17eac7d829dcd0cf244c5c617fc49d35e8774e8af1fa1205eeebe0cca81f538a2a61f6a7ba200878bc6
2021-09-06Merge bitcoin/bitcoin#22791: init: Fix asmap/addrman initialization order bugMarcoFalke
724c4975622bc22cedc3f3814dfc8e66cf8371f7 [fuzz] Add ConsumeAsmap() function (John Newbery) 5840476714ffebb2599999c85a23b52ebcff6090 [addrman] Make m_asmap private (John Newbery) f9002cb5dbd573cd9ca200de21319fa296e26055 [net] Rename the copyStats arg from m_asmap to asmap (John Newbery) f572f2b2048994b3b50f4cfd5de19e40b1acfb22 [addrman] Set m_asmap in CAddrMan initializer list (John Newbery) 593247872decd6d483a76e96d79433247226ad14 [net] Remove CConnMan::SetAsmap() (John Newbery) 50fd77045e2f858a53486b5e02e1798c92ab946c [init] Read/decode asmap before constructing addrman (John Newbery) Pull request description: Commit 181a1207 introduced an initialization order bug: CAddrMan's m_asmap must be set before deserializing peers.dat. The first commit restores the correct initialization order. The remaining commits make `CAddrMan::m_asmap` usage safer: - don't reach into `CAddrMan`'s internal data from `CConnMan` - set `m_asmap` in the initializer list and make it const - make `m_asmap` private, and access it (as a reference to const) from a getter. This ensures that peers.dat deserialization must happen after setting m_asmap, since m_asmap is set during CAddrMan construction. ACKs for top commit: mzumsande: Tested ACK 724c4975622bc22cedc3f3814dfc8e66cf8371f7 amitiuttarwar: code review but utACK 724c497562 naumenkogs: utACK 724c4975622bc22cedc3f3814dfc8e66cf8371f7 vasild: ACK 724c4975622bc22cedc3f3814dfc8e66cf8371f7 MarcoFalke: review ACK 724c4975622bc22cedc3f3814dfc8e66cf8371f7 👫 Tree-SHA512: 684a4cf9e3d4496c9997fb2bc4ec874809987055c157ec3fad1d2143b8223df52b5a0af787d028930b27388c8efeba0aeb2446cb35c337a5552ae76112ade726
2021-09-06Merge bitcoin/bitcoin#22848: MOVEONLY: Expose BanMapToJson / BanMapFromJsonMarcoFalke
6919c823cbce92248647880fb1d912828449ae57 MOVEONLY: Expose BanMapToJson / BanMapFromJson (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- CSubNet serialization code that was removed in #22570 fa4e6afdae7b82df638b60edf37ac36d57a8cb4f was needed by multiprocess code to share ban map between gui and node processes. Rather than adding it back, use suggestion from MarcoFalke https://github.com/bitcoin/bitcoin/pull/10102#discussion_r690922929 to use JSON serialization. This requires making BanMapToJson / BanMapFromJson functions public. ACKs for top commit: promag: reACK 6919c823cbce92248647880fb1d912828449ae57. Tree-SHA512: ce909a61b7869d16cf2e9f91b643dd9d2604efc5777703d3b77a4c40cb0ccdd20396ba87b1ec85aade142e12ff9ea4c95c7155840354873579565471779f5a33