aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-06-27Merge bitcoin/bitcoin#25404: p2p, doc: Use MAX_BLOCKS_TO_ANNOUNCE consistentlyfanquake
e357c8953880715a943b892deed04e7777187999 p2p, doc: Use MAX_BLOCKS_TO_ANNOUNCE consistently (Martin Zumsande) Pull request description: Block announcements via headers may have up to `MAX_BLOCKS_TO_ANNOUNCE = 8` entries according to the definition of this constant. However, there are a few spots saying they should have a size _less than_ `MAX_BLOCKS_TO_ANNOUNCE`. Fix these. I don't think that this is critical (this only changes behavior when we get a headers announcement with exactly `MAX_BLOCKS_TO_ANNOUNCE` blocks which we can't connect), but it would be nice to handle this limit consistently. ACKs for top commit: dergoegge: utACK e357c8953880715a943b892deed04e7777187999 - This PR makes the usage and docs of `MAX_BLOCKS_TO_ANNOUNCE` consistent with its description. Tree-SHA512: f3772026ab0f402e3a551127ef6e4a98fa9e7af250715fe317c05988b5b33f2f3e098a00e03960d4d28c8bd2b7a97231f7f99f22f1c152c000b2e27b658cf8f2
2022-06-27Merge bitcoin/bitcoin#25144: refactor: Pass Peer& to Misbehaving()MacroFake
fa8aa0aa8180c3a0369c7589b8747666778a0deb Pass Peer& to Misbehaving() (MacroFake) Pull request description: `Misbehaving` has several coding related issues (ignoring the conceptual issues here for now): * It is public, but it is not supposed to be called from outside of net_processing. Fix that by making it private and creating a public `UnitTestMisbehaving` method for unit testing only. * It doesn't do anything if a `nullptr` is passed. It would be less confusing to just skip the call instead. Fix that by passing `Peer&` to `Misbehaving()`. * It calls `GetPeerRef`, causing `!m_peer_mutex` lock annotations to be propagated. This is harmless, but verbose. Fix it by removing the no longer needed call to `GetPeerRef` and the no longer needed lock annotations. ACKs for top commit: vasild: ACK fa8aa0aa8180c3a0369c7589b8747666778a0deb w0xlt: Code Review ACK https://github.com/bitcoin/bitcoin/pull/25144/commits/fa8aa0aa8180c3a0369c7589b8747666778a0deb Tree-SHA512: e60a6b317f2b826f9e0724285d00b632d3e2a91ded9fa5ba01c80766c5d39270b719be234c01302d46eaba600910032693836aa116ff05ee1b590c7530881cd3
2022-06-27Merge bitcoin/bitcoin#23418: Fix signed integer overflow in ↵MacroFake
prioritisetransaction RPC fa07f84e316171d60dd9941fb8db37e0a0de6654 Fix signed integer overflow in prioritisetransaction RPC (MarcoFalke) fa52cf8e11b3af6e0a302d5d17aab6cea78899d5 refactor: Replace feeDelta by m_modified_fee (MarcoFalke) Pull request description: Signed integer overflow is UB in theory, but not in practice. Still, it would be nice to avoid this UB to allow Bitcoin Core to be compiled with sanitizers such as `-ftrapv` or ubsan. It is impossible to predict when and if an overflow occurs, since the overflow caused by a prioritisetransaction RPC might only be later hit when descendant txs are added to the mempool. Since it is impossible to predict reliably, leave it up to the user to use the RPC endpoint responsibly, considering their mempool limits and usage patterns. Fixes: #20626 Fixes: #20383 Fixes: #19278 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34146 / https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47132 ## Steps to reproduce Build the code without the changes in this pull. Make sure to pass the sanitizer flag: ``` ./autogen.sh && ./configure --with-sanitizers=signed-integer-overflow && make clean && make -j $(nproc) ``` ### Reproduce on RPC ``` ./src/bitcoind -chain=regtest -noprinttoconsole & ./src/bitcoin-cli -chain=regtest prioritisetransaction 00000000deadbeef00000000deadbeef00000000deadbeef00000000deadbeef 0 9123456789123456789 ./src/bitcoin-cli -chain=regtest prioritisetransaction 00000000deadbeef00000000deadbeef00000000deadbeef00000000deadbeef 0 9123456789123456789 |> txmempool.cpp:920:15: runtime error: signed integer overflow: 9123456789123456789 + 9123456789123456789 cannot be represented in type 'long int' ./src/bitcoin-cli -chain=regtest stop ``` ### By fuzzing ``` wget https://github.com/bitcoin/bitcoin/files/8921302/clusterfuzz-testcase-minimized-validation_load_mempool-5599531390074880.bin.txt FUZZ=validation_load_mempool ./src/test/fuzz/fuzz ./clusterfuzz-testcase-minimized-validation_load_mempool-5599531390074880.bin.txt |> txmempool.cpp:920:15: runtime error: signed integer overflow: 7214801925397553184 + 2314885530818453536 cannot be represented in type 'long int' |> validation_load_mempool: succeeded against 1 files in 0s. ACKs for top commit: vasild: ACK fa07f84e316171d60dd9941fb8db37e0a0de6654 dunxen: ACK fa07f84 LarryRuane: ACK fa07f84e316171d60dd9941fb8db37e0a0de6654 Tree-SHA512: 4a357950af55a49c9113da0a50c2e743c5b752f0514dd8d16cd92bfde2f77dd0ef56aa98452626df6f7f7a5b51d1227021f6bc94091201a179f0d488ee32a0df
2022-06-27Merge bitcoin/bitcoin#25439: rpc: Return incrementalrelayfee in getmempoolinfoMacroFake
fafee78188c3de5f6245ec769429822ca4b98c63 rpc: Return incrementalrelayfee in getmempoolinfo (MacroFake) Pull request description: Seems odd to return other policy info, but not the incremental relay fee ACKs for top commit: 1440000bytes: ACK https://github.com/bitcoin/bitcoin/pull/25439/commits/fafee78188c3de5f6245ec769429822ca4b98c63 w0xlt: Code Review ACK https://github.com/bitcoin/bitcoin/pull/25439/commits/fafee78188c3de5f6245ec769429822ca4b98c63 jarolrod: tACK fafee78188c3de5f6245ec769429822ca4b98c63 Tree-SHA512: faad0af6c039b8257acbeac913bc5dcdb2ea2db304c95e52601536c8de60eb1186e9fbb4a64a68adf476605f18022aeda16a5644a0d7912592b0977e4c029638
2022-06-24Merge bitcoin/bitcoin#25456: rpc: Use steady_clock for getrpcinfo durationsMacroFake
fabae3541ac574a1101be8dc54f1499dbbf2f231 rpc: Use steady_clock for getrpcinfo durations (MacroFake) Pull request description: Currently it uses `GetTimeMicros`, which is the system time. Using steady time instead, makes the code type safe and avoids spurious offsets when the system time adjusts. ACKs for top commit: laanwj: Code review ACK fabae3541ac574a1101be8dc54f1499dbbf2f231 w0xlt: Code Review ACK https://github.com/bitcoin/bitcoin/pull/25456/commits/fabae3541ac574a1101be8dc54f1499dbbf2f231 shaavan: Code Review ACK fabae3541ac574a1101be8dc54f1499dbbf2f231 Tree-SHA512: eb25fe3e69bf42ec8a2d4aaa69b435de7654b0d07218ce3e0c03ebaef6eb7f713128779057d012621773a34675a81f5757e7b2502c13b82adaf6e2df970d8c66
2022-06-24Merge bitcoin/bitcoin#25438: refactor: remove unused methods in classes ↵MacroFake
`CDBIterator,CDBWrapper,CCoinsViewDBCursor` e4b4db561049c97c956e5b856713dcf63ac3e2f0 refactor: remove unused method `CDBWrapper::CompactRange` (Sebastian Falbesoner) fb38c6e21f064e23b63a46d15adb873029463cff refactor: remove unused methods `{CDBIterator,CCoinsViewDBCursor}::GetValueSize()` (Sebastian Falbesoner) Pull request description: The `GetValueSize` methods haven't been used since the chainstate db cache has been switched from per-tx to per-txout model years ago (PR #10195, commit d342424301013ec47dc146a4beb49d5c9319d80a). The `CompactRange` is unused since the txindex migration code was removed (PR https://github.com/bitcoin/bitcoin/pull/22626, commit https://github.com/bitcoin/bitcoin/commit/fa20f815a9cb438c5ab61e97a453612ddd8b21b5). ACKs for top commit: fanquake: ACK e4b4db561049c97c956e5b856713dcf63ac3e2f0 furszy: re-ACK e4b4db56 laanwj: Code review ACK e4b4db561049c97c956e5b856713dcf63ac3e2f0 Tree-SHA512: 77da445fb70c744046263c6f2ddb05782b68e3d4b2ea604dd7c7dc73ce7c1f2d2b48ec68db4dcb03e35fc27488b99b0a420f6fa3d5b83d325c1708ed68e99e0a
2022-06-23Merge bitcoin/bitcoin#25457: Use more specific path when including ↵laanwj
`memenv.h` header f3b5c1e4522f13060e9ace2913203e7a6b2eb2d1 Use more specific path when including `memenv.h` header (Hennadii Stepanov) Pull request description: This PR makes our code base compatible with `leveldb`'s own CMake [project](https://github.com/bitcoin/bitcoin/blob/master/src/leveldb/CMakeLists.txt). Required for https://github.com/hebasto/bitcoin/pull/3. As a justification, please note that internally `leveldb` uses `#include "helpers/memenv/memenv.h"` rather `#include "memenv.h"`. #### Guix builds on `arm64`: ``` # find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum 0e069318a681f9f848e803e5df8b25426b47ddc8994a21e0b83f0f86e7db7ae0 guix-build-f3b5c1e4522f/output/arm-linux-gnueabihf/SHA256SUMS.part e68e1b65514d42f1e33b2754356b68d3ddea1fe9df89d02df51375792867dd8c guix-build-f3b5c1e4522f/output/arm-linux-gnueabihf/bitcoin-f3b5c1e4522f-arm-linux-gnueabihf-debug.tar.gz 6b1b5c1f9525e8e467d038751bfc070ed6cbfbd42b17add2faac76fee421343e guix-build-f3b5c1e4522f/output/arm-linux-gnueabihf/bitcoin-f3b5c1e4522f-arm-linux-gnueabihf.tar.gz 9f8e941f37aa243fd36c1eaade9b88081b2a27562bfe7d8208d3c6021ecb6f03 guix-build-f3b5c1e4522f/output/arm64-apple-darwin/SHA256SUMS.part 88cf46d00e67f3493e6ecbb85002ca0ff93dd47af3e93e51d95f92ed3218752f guix-build-f3b5c1e4522f/output/arm64-apple-darwin/bitcoin-f3b5c1e4522f-arm64-apple-darwin-unsigned.dmg 5afa9ae6943386ae600d612f1ed4831c0e92011f87284ae25465c2ffc6b8bb2b guix-build-f3b5c1e4522f/output/arm64-apple-darwin/bitcoin-f3b5c1e4522f-arm64-apple-darwin-unsigned.tar.gz 0b72a400f842ff31233ced2aadf0b8309ba6695b075b9f4345708dca235f6368 guix-build-f3b5c1e4522f/output/arm64-apple-darwin/bitcoin-f3b5c1e4522f-arm64-apple-darwin.tar.gz 7912417348175c293002ccd3413ecb53c5a1d29a234959a94bdbd6481bd58d08 guix-build-f3b5c1e4522f/output/dist-archive/bitcoin-f3b5c1e4522f.tar.gz f8d28c57dc97fd1e6844fcb2679f2a44fc360ef37aad3fc4185fa1d091baf4b1 guix-build-f3b5c1e4522f/output/powerpc64-linux-gnu/SHA256SUMS.part c219a024c95bcdfe28961c18b8118152becf201b00f9e0e28ff35a7a2646fc9b guix-build-f3b5c1e4522f/output/powerpc64-linux-gnu/bitcoin-f3b5c1e4522f-powerpc64-linux-gnu-debug.tar.gz 2790ff48593be1699e4175cc31a6cc11fd2e758cdc99220c5a87ddb658d8a794 guix-build-f3b5c1e4522f/output/powerpc64-linux-gnu/bitcoin-f3b5c1e4522f-powerpc64-linux-gnu.tar.gz 8d13f9f6141776263faceb396cbe3089e5c165523a5da160ba9ec6814744f7d4 guix-build-f3b5c1e4522f/output/powerpc64le-linux-gnu/SHA256SUMS.part 72c1e8d7a9f2f0ff76c1dd84b4614202ce6734cb8ff29b2cf2cfc20a218d3aa5 guix-build-f3b5c1e4522f/output/powerpc64le-linux-gnu/bitcoin-f3b5c1e4522f-powerpc64le-linux-gnu-debug.tar.gz ed0494b336a1ae00050137ed0d18130d5c1213e6d45fada439de4e799ebfb720 guix-build-f3b5c1e4522f/output/powerpc64le-linux-gnu/bitcoin-f3b5c1e4522f-powerpc64le-linux-gnu.tar.gz a2a11b57a4a93b0b079c87c303e4c5250b16994d20f87ae362850efc1c181e57 guix-build-f3b5c1e4522f/output/riscv64-linux-gnu/SHA256SUMS.part ff63220629ef4b318cc9c2b858204961bc29fd0e901817a39e50e6893925f153 guix-build-f3b5c1e4522f/output/riscv64-linux-gnu/bitcoin-f3b5c1e4522f-riscv64-linux-gnu-debug.tar.gz eb0c0b3709a2d4fe9a6c18ad7a14b90a32fe8a5a7d72f75400ae014f2c847264 guix-build-f3b5c1e4522f/output/riscv64-linux-gnu/bitcoin-f3b5c1e4522f-riscv64-linux-gnu.tar.gz a82bb28e2a8c6523854f4f9d6ff89d6ba096fff526f17bf6182fd6b2ebf96395 guix-build-f3b5c1e4522f/output/x86_64-apple-darwin/SHA256SUMS.part 91d2eea67bfde7a363c6ede8c358fb3de842b55cfe428abafa7b5985d619c62c guix-build-f3b5c1e4522f/output/x86_64-apple-darwin/bitcoin-f3b5c1e4522f-x86_64-apple-darwin-unsigned.dmg f3cbc79b8fac7e8a8c9ba63b774cadb5a09cd64cc942e7b68cd1fc566b371021 guix-build-f3b5c1e4522f/output/x86_64-apple-darwin/bitcoin-f3b5c1e4522f-x86_64-apple-darwin-unsigned.tar.gz 91fb98ed086613bb85959e9fc060ef0f816d5b4d52087b003c6a72ecf1c1309b guix-build-f3b5c1e4522f/output/x86_64-apple-darwin/bitcoin-f3b5c1e4522f-x86_64-apple-darwin.tar.gz 62309af3fc8316abd4c8f8285c666c568c140b9312f252a47ca6611fb51fef5e guix-build-f3b5c1e4522f/output/x86_64-linux-gnu/SHA256SUMS.part deb27b75f52fb40cd13bfc6d594ed5ff0d82d1c211e2a6a91b9ca06ee3b8335b guix-build-f3b5c1e4522f/output/x86_64-linux-gnu/bitcoin-f3b5c1e4522f-x86_64-linux-gnu-debug.tar.gz 89faeb1f32f0447d26a73253a9f581b40b01982862351a7dd0cee05c8dbf29cc guix-build-f3b5c1e4522f/output/x86_64-linux-gnu/bitcoin-f3b5c1e4522f-x86_64-linux-gnu.tar.gz 5de46eec42bcd1e2e0fd3c9c6978a8a945b95411a9051fac9bb8a65d6b4875a5 guix-build-f3b5c1e4522f/output/x86_64-w64-mingw32/SHA256SUMS.part 3271137a901889a38214173f01f96ae98385ea607e9573eaa2966e68c68401e1 guix-build-f3b5c1e4522f/output/x86_64-w64-mingw32/bitcoin-f3b5c1e4522f-win64-debug.zip 7a74bf455bffa0d2abb99ce31ea1ef8088928f54c1f3c6e27044392f27e3e752 guix-build-f3b5c1e4522f/output/x86_64-w64-mingw32/bitcoin-f3b5c1e4522f-win64-setup-unsigned.exe 73a23fd9846e615afcd569adc79fafdcf55b0efa9c383d2d0c9579fb0f79b91a guix-build-f3b5c1e4522f/output/x86_64-w64-mingw32/bitcoin-f3b5c1e4522f-win64-unsigned.tar.gz ee5f3f9eb65f0ac1c0879d0aaa88cf20d8ca9329ba505f77580a0c9b57cd3244 guix-build-f3b5c1e4522f/output/x86_64-w64-mingw32/bitcoin-f3b5c1e4522f-win64.zip ``` ACKs for top commit: laanwj: Code review ACK f3b5c1e4522f13060e9ace2913203e7a6b2eb2d1 fanquake: ACK f3b5c1e4522f13060e9ace2913203e7a6b2eb2d1 Tree-SHA512: 62e7cf49bc4ce08c8373a0fcfaf4ca10a83d18d0d00bdb21983c25b4b9192ace74acf64362b47faa429d13dbaf63be953fd3aa3b92366603866a472f95ef09a1
2022-06-23Merge bitcoin/bitcoin#25446: p2p: Set CNode::m_relays_txs=true when ↵fanquake
receiving BIP37 filters e7a9133766a2dc357a79d38cd47231cc99cdefb7 [net processing] Set CNode::m_relays_txs=true when receiving BIP37 filters (dergoegge) Pull request description: This line was accidentally removed in https://github.com/bitcoin/bitcoin/pull/22778. Receiving a `filterload` message implies that we should relay txs to the sender (`CNode::m_relays_txs = true`). `CNode::m_relays_txs` is only used for the inbound eviction logic, so removing the line might have slightly changed the eviction behaviour but nothing else. ACKs for top commit: laanwj: Code review ACK e7a9133766a2dc357a79d38cd47231cc99cdefb7 vasild: ACK e7a9133766a2dc357a79d38cd47231cc99cdefb7 Tree-SHA512: 19c5df0f579f707c6c7900d12a6b71ac69e802be64f7d2fdcc40ac714c918dc4c17def164592f8836cc105a03daefefca3ca5e10423145eca8db4348c27c9cfc
2022-06-23Use more specific path when including `memenv.h` headerHennadii Stepanov
2022-06-23rpc: Use steady_clock for getrpcinfo durationsMacroFake
2022-06-23refactor: remove unused method `CDBWrapper::CompactRange`Sebastian Falbesoner
This method hasn't been used since the txindex migration code has been removed (PR #22626, commit fa20f815a9cb438c5ab61e97a453612ddd8b21b5). Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2022-06-23Merge bitcoin-core/gui#623: Getting ready to Qt 6 (9/n). Apply Qt 6 specific ↵laanwj
changes d8d99d041a063a1719fc1d43ecd4a6365e0657ca qt6: Do not use deprecated high DPI attributes in Qt 6 (Hennadii Stepanov) 8927bb8f063e88546fd9cf2ce595902d2ea63bb6 refactor: Fix style in `initTranslations()` function (Hennadii Stepanov) ad73447dc2bd04120c4eb7f5757613ad35a35cf5 qt6: Do not use deprecated `QLibraryInfo::path` in Qt 6 (Hennadii Stepanov) 3f51d0b8b2b2fabf5e305bd71226a8e3e5f3ad2d qt6: Fix type registration (Hennadii Stepanov) Pull request description: One more step in migration to Qt 6. Could be tested with hebasto/bitcoin#3 or bitcoin/bitcoin#24798. No behavior change when compiling with Qt 5. ACKs for top commit: laanwj: Code review ACK d8d99d041a063a1719fc1d43ecd4a6365e0657ca jarolrod: ACK d8d99d041a063a1719fc1d43ecd4a6365e0657ca Tree-SHA512: e5f92a80f8622e5f95dd98a90783956a26d3c8382b9ca8e479fb6c152cfdc85a2f6084e78d463ceea1e0f0b3ac72d2b086c8ca24967b2b6070553317e9e3252e
2022-06-22Merge bitcoin/bitcoin#25428: Remove Sock::Release() and CloseSocket()laanwj
a724c39606273dfe4c6f9887ef8b77d0a98f1b34 net: rename Sock::Reset() to Sock::Close() and make it private (Vasil Dimov) e8ff3f0c52e7512a580bc907dc72e5bb141b4217 net: remove CloseSocket() (Vasil Dimov) 175fb2670a2a24220afb3eea99b7b65b0aa89c76 net: remove now unused Sock::Release() (Vasil Dimov) Pull request description: _This is a piece of #21878, chopped off to ease review._ * `Sock::Release()` is unused, thus remove it * `CloseSocket()` is only called from `Sock::Reset()`, so move the body of `CloseSocket()` inside `Sock::Reset()` and remove `CloseSocket()` - this helps to hide low level file descriptor sockets inside the `Sock` class. * Rename `Sock::Reset()` to `Sock::Close()` and make it `private` - to be used only in the destructor and in the `Sock` assignment operator. This simplifies the public API by removing one method from it. ACKs for top commit: laanwj: Code review ACK a724c39606273dfe4c6f9887ef8b77d0a98f1b34 Tree-SHA512: 4b12586642b3d049092fadcb1877132e285ec66a80af92563a7703c6970e278e0f2064fba45c7eaa78eb65db94b3641fd5e5264f7b4f61116d1a6f3333868639
2022-06-22[net processing] Set CNode::m_relays_txs=true when receiving BIP37 filtersdergoegge
This line was accidentally removed in #22778.
2022-06-22Fix signed integer overflow in prioritisetransaction RPCMarcoFalke
2022-06-22refactor: Replace feeDelta by m_modified_feeMarcoFalke
* feeDelta tracked the delta (to be applied on top of the actual fee) * m_modified_fee tracks the actual fee with the delta included * Instead of passing in the new total delta to the Updater, pass in by how much the total delta should be modified. This is needed for the next commit, but makes sense on its own because the same is done by UpdateDescendantState and UpdateAncestorState.
2022-06-22net: rename Sock::Reset() to Sock::Close() and make it privateVasil Dimov
Outside of `Sock`, `Sock::Reset()` was used in just one place (in `i2p.cpp`) which can use the assignment operator instead. This simplifies the public `Sock` API by having one method less.
2022-06-22build: Remove negated --enable-fuzz checks from build systemMarcoFalke
2022-06-22Merge bitcoin/bitcoin#25440: log: Use consistent wording in random.cpp logMacroFake
c01ae8f5ead6837162a2772ce792a83f66757ee4 Use consistent wording in log (Igor Bubelov) Pull request description: It's a trivial change, but it bothers me a bit that two log lines in a row aren't grammatically identical while following exactly the same pattern. I've read `contributing.md` and I'm aware that changes like this are usually being ignored and dropped, but I decided to leave it here anyway in case someone feels the same way about inconsistent log messages or grammar =) ACKs for top commit: laanwj: Code review ACK c01ae8f5ead6837162a2772ce792a83f66757ee4 Tree-SHA512: d5b3849b3a6e3de7ea9b468c05f17cacd1dbd1aca2f3401b5138383dc8d385cea9e221db558ab472c1c4c7f6921d57dcc7af89a54776c5765fa00e429694b4e7
2022-06-22Merge bitcoin/bitcoin#24352: Add doc/design/libraries.mdlaanwj
dc1e7ad7a5713d885f70ccc6c93e7a4c07e76559 Add doc/design/libraries.md (Ryan Ofsky) Pull request description: Prompted by the [libbitcoinkernel issue #24303](https://github.com/bitcoin/bitcoin/issues/24303) and PRs, I started looking at existing libraries and what their dependencies are and wrote this document to describe them and where `libbitcoinkernel` fits in. Readable link is: https://github.com/ryanofsky/bitcoin/blob/pr/libs/doc/design/libraries.md Feedback is welcome ACKs for top commit: laanwj: ACK dc1e7ad7a5713d885f70ccc6c93e7a4c07e76559 hebasto: Approach ACK dc1e7ad7a5713d885f70ccc6c93e7a4c07e76559, using this doc as a guide in https://github.com/hebasto/bitcoin/pull/3 :) Tree-SHA512: 7687b1847797c50de1f5ea721bd201cc8304690064743fbe6d69e2198cc239084e9da7d158be65bea948a6ec3d71d74c84122c0e523c390b389b49ea8d2cddc9
2022-06-22Merge bitcoin-core/gui#620: Replace `QRegExp` with `QRegularExpression`laanwj
67364ebe4c499eb8effe8dac11a5e3648f30c6c7 test, qt: Add tests for `GUIUtil::extractFirstSuffixFromFilter` (w0xlt) ace9af5688662a56d855bd26f36bc5c145b909e3 qt: Replace `QRegExp` with `QRegularExpression` (w0xlt) c378535e28e0c54353fde9c4a66cb3134a3ee742 qt: Add a function that extracts the suffix from a filter (w0xlt) Pull request description: Picking up https://github.com/bitcoin-core/gui/pull/606 (labeled "Up for grabs") and applying https://github.com/bitcoin-core/gui/pull/606#pullrequestreview-984607067 and https://github.com/bitcoin-core/gui/pull/606#issuecomment-1137149907. Replaces occurrences of `QRegExp` usage with `QRegularExpression` as part of the roadmap for Qt6 integration. Fixes https://github.com/bitcoin-core/gui/issues/578 ACKs for top commit: laanwj: Code review and lightly tested ACK 67364ebe4c499eb8effe8dac11a5e3648f30c6c7 hebasto: ACK 67364ebe4c499eb8effe8dac11a5e3648f30c6c7 Tree-SHA512: 4a17d83e557bc635cbd1a15776856e9edb7162b23a369ccbd2ac59c68b8a1ea663baaa7d5ad98e419dc03b91ef3315c768eeadc01c0b29162de109493161e814
2022-06-21Merge bitcoin/bitcoin#25427: wallet: remove extra wtx lookup in AddToSpendsAndrew Chow
32e5edc0f454c59c8e0d8d86a9abfa9a3f25ca28 wallet: avoid extra wtx lookup in AddToSpends (furszy) Pull request description: As `AddToSpends` is only called from `AddToWallet` and `LoadToWallet`, places where we insert the wtx into the wallet map, we can directly feed `AddToSpends` with the `wtx` and remove another extra lookup. ACKs for top commit: laanwj: Code review ACK 32e5edc0f454c59c8e0d8d86a9abfa9a3f25ca28 achow101: ACK 32e5edc0f454c59c8e0d8d86a9abfa9a3f25ca28 theStack: Code-review ACK 32e5edc0f454c59c8e0d8d86a9abfa9a3f25ca28 w0xlt: Code Review ACK https://github.com/bitcoin/bitcoin/pull/25427/commits/32e5edc0f454c59c8e0d8d86a9abfa9a3f25ca28 brunoerg: crACK 32e5edc0f454c59c8e0d8d86a9abfa9a3f25ca28 Tree-SHA512: e9fb8df44c3e3fa26c107d261bf78e45014b4755890a64817f2be62ee6b7751f5dd2813a18dcb103a21ddba1422f9d2d59c4bf186f08314e634365d36b01be8f
2022-06-21test, qt: Add tests for `GUIUtil::extractFirstSuffixFromFilter`w0xlt
2022-06-21qt: Replace `QRegExp` with `QRegularExpression`w0xlt
Co-authored-by: Pavol Rusnak <pavol@rusnak.io> Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
2022-06-21qt: Add a function that extracts the suffix from a filterw0xlt
Extract the 'Extract first suffix from filter pattern...' functionality into a testable utility function
2022-06-22Merge bitcoin/bitcoin#25314: p2p: always set nTime for self-advertisementslaanwj
99b9e5f3a9fa29bbc1e45fc958470fbcc207ef23 p2p: always set nTime for self-advertisements (Martin Zumsande) Pull request description: This logic was recently changed in https://github.com/bitcoin/bitcoin/commit/0cfc0cd32239d3c08d2121e028b297022450b320 to overwrite `addrLocal` with the address they gave us when self-advertising to an inbound peer. But if we don't also change `nTime` again from the default `TIME_INIT`, our peer will not relay our advertised address any further. ACKs for top commit: naumenkogs: ACK 99b9e5f3a9fa29bbc1e45fc958470fbcc207ef23 laanwj: Code review ACK 99b9e5f3a9fa29bbc1e45fc958470fbcc207ef23 vasild: ACK 99b9e5f3a9fa29bbc1e45fc958470fbcc207ef23 Tree-SHA512: 4c7ea51cc77ddaa4b3537962ad2ad085f7ef5322982d3b1f5baecb852719eb99dd578436ca63432cb6b0a4fbd8b59fca793caf326c4663a4d6f34301e8146aa2
2022-06-21rpc: Return incrementalrelayfee in getmempoolinfoMacroFake
2022-06-21Use consistent wording in logIgor Bubelov
2022-06-21refactor: remove unused methods ↵Sebastian Falbesoner
`{CDBIterator,CCoinsViewDBCursor}::GetValueSize()` These methods haven't been used since the chainstate db cache has been switched from per-tx to per-txout model years ago (PR #10195, commit d342424301013ec47dc146a4beb49d5c9319d80a).
2022-06-21qt6: Do not use deprecated high DPI attributes in Qt 6Hennadii Stepanov
In Qt 6, high DPI pixmaps and scaling are always enabled. https://doc.qt.io/qt-6/highdpi.html
2022-06-21refactor: Fix style in `initTranslations()` functionHennadii Stepanov
2022-06-21qt6: Do not use deprecated `QLibraryInfo::path` in Qt 6Hennadii Stepanov
See https://doc.qt.io/qt-6/qtcore-changes-qt6.html#other-classes
2022-06-21qt6: Fix type registrationHennadii Stepanov
In Qt 6, registration of `QDataStream` streaming operators is done automatically. Consequently, `qRegisterMetaTypeStreamOperators()` does no longer exist. Calls to this method have to be removed when porting to Qt 6. See https://doc.qt.io/qt-6/qtcore-changes-qt6.html#the-qmetatype-class
2022-06-21Merge bitcoin/bitcoin#25422: build: globally define NOMINMAX when building ↵laanwj
with mingw-w64 58a9601dffa6d9b3b881a476169458787d382919 build: globally define NOMINMAX (fanquake) Pull request description: Define (and document) `NOMINMAX` once, rather than across multiple source files. Defining this prevents the definition of min/max macros when using mingw-w64, which may conflict with unprefixed std::min/max usage. While that might not be the case for us, we'd always prefer to use the standard library in any case. For example: https://github.com/mingw-w64/mingw-w64/blob/73cadc06c62c6af5faf76f64ef08e684b48de48c/mingw-w64-headers/include/ntdef.h#L289-L300 Note that we already define NOMINMAX globally when building with MSVC. Guix Build (arm64): ```bash d3a3b7045dc1677f6a0a2a73a484f156c81ae764058003d9e870b346912b744a guix-build-58a9601dffa6/output/arm-linux-gnueabihf/SHA256SUMS.part 3e66540a3f8c8a10864ab2fed69581241fa41af86bbb028e5f7c3dd4ba859c64 guix-build-58a9601dffa6/output/arm-linux-gnueabihf/bitcoin-58a9601dffa6-arm-linux-gnueabihf-debug.tar.gz 78756e20d45e327cfd7f9e65858bf6d3814bcbe08f9f825fd6dfc9dff999ea6d guix-build-58a9601dffa6/output/arm-linux-gnueabihf/bitcoin-58a9601dffa6-arm-linux-gnueabihf.tar.gz 11073e88d4fd0411c5119a3dca3a90788693fa9aa5134339c84be98ae893cd77 guix-build-58a9601dffa6/output/arm64-apple-darwin/SHA256SUMS.part deffd5f8c6286be34bc35e71ec70300bacb37e1b1a83e67c0833cb57d7a45529 guix-build-58a9601dffa6/output/arm64-apple-darwin/bitcoin-58a9601dffa6-arm64-apple-darwin-unsigned.dmg acee7e98c5ec41f67e86c78dc5b45fa8bc82de86a04b8c43dbf9c59e7aff36a9 guix-build-58a9601dffa6/output/arm64-apple-darwin/bitcoin-58a9601dffa6-arm64-apple-darwin-unsigned.tar.gz 83f7cbaf6680fe8981db9260b97ca87d609a76c0857a744c7d406645d2484e1b guix-build-58a9601dffa6/output/arm64-apple-darwin/bitcoin-58a9601dffa6-arm64-apple-darwin.tar.gz b8c73b40a5e307e9e7e482ce92164990d442f3f105a5240ec6eb96a775cb35d5 guix-build-58a9601dffa6/output/dist-archive/bitcoin-58a9601dffa6.tar.gz cc435cd925771af7e261d0121047339ea8fddb0d1548b699c12108a62988cd32 guix-build-58a9601dffa6/output/powerpc64-linux-gnu/SHA256SUMS.part 7a68bd3181a054056b0a5eb6e830b90ac4ba8435114127d5f1720643011aa78f guix-build-58a9601dffa6/output/powerpc64-linux-gnu/bitcoin-58a9601dffa6-powerpc64-linux-gnu-debug.tar.gz bc55b95e263c455a964d9463a3ee60dabee1d10cefc6641ed29a3b1b317d61e0 guix-build-58a9601dffa6/output/powerpc64-linux-gnu/bitcoin-58a9601dffa6-powerpc64-linux-gnu.tar.gz 49df78009d80af02262806c6c395e2c884a979b1ea13d01aa27d8188403e29d1 guix-build-58a9601dffa6/output/powerpc64le-linux-gnu/SHA256SUMS.part 29dc7a0e10707b3511fa2afb6977df7ebbb67f796d8be5a042abc14eba764aef guix-build-58a9601dffa6/output/powerpc64le-linux-gnu/bitcoin-58a9601dffa6-powerpc64le-linux-gnu-debug.tar.gz 51b7f8e1bccff1e2ce1860bbc382eefe648b90cc3374cdfa3a95a7454386e77d guix-build-58a9601dffa6/output/powerpc64le-linux-gnu/bitcoin-58a9601dffa6-powerpc64le-linux-gnu.tar.gz e62e46d8cebbbfc0f587e930acb648fcae99cfe8b2f63aeba98e46e3338fe1e3 guix-build-58a9601dffa6/output/riscv64-linux-gnu/SHA256SUMS.part fa5d0a074ca586583bf08dbf748909b3ff5e0a54a2e5aaa88abec666e17b4e72 guix-build-58a9601dffa6/output/riscv64-linux-gnu/bitcoin-58a9601dffa6-riscv64-linux-gnu-debug.tar.gz 684b2917fd27a41f884bb6870f7fac847d52b6f8b40df5779d1c674409f7cd14 guix-build-58a9601dffa6/output/riscv64-linux-gnu/bitcoin-58a9601dffa6-riscv64-linux-gnu.tar.gz 7d7cfd0212b49eec48c7f8dc0d97add53096685dfd646feac466c27a45d20c97 guix-build-58a9601dffa6/output/x86_64-apple-darwin/SHA256SUMS.part d70ae6d060b7832f8741dc5d1958cc0d32702605c863254303107246deec0aa6 guix-build-58a9601dffa6/output/x86_64-apple-darwin/bitcoin-58a9601dffa6-x86_64-apple-darwin-unsigned.dmg 930f3ec43896404208ebdb582c9175e3a5a2470d778722e0001addde84dad99a guix-build-58a9601dffa6/output/x86_64-apple-darwin/bitcoin-58a9601dffa6-x86_64-apple-darwin-unsigned.tar.gz 2d8a9d12aadcf60634db953fcb8bd496a002608e9a64eb7d60bb7ffe1f94489f guix-build-58a9601dffa6/output/x86_64-apple-darwin/bitcoin-58a9601dffa6-x86_64-apple-darwin.tar.gz 10363729ece6e1c2cbdf435483006191bf17d1def2d318ff8357197d91c06ded guix-build-58a9601dffa6/output/x86_64-linux-gnu/SHA256SUMS.part d50ec8e4f72e8b064b196eb0ece212f7b0b126f4b8b644c4451084cbf0416072 guix-build-58a9601dffa6/output/x86_64-linux-gnu/bitcoin-58a9601dffa6-x86_64-linux-gnu-debug.tar.gz 471e12b8715ecff4d99121c4bb3288ef4b005ca468810a714c67ea3e7c6669e9 guix-build-58a9601dffa6/output/x86_64-linux-gnu/bitcoin-58a9601dffa6-x86_64-linux-gnu.tar.gz d63946401952d131fdf5df9442c52151d86e53f019234b5ad16fdef0d2976356 guix-build-58a9601dffa6/output/x86_64-w64-mingw32/SHA256SUMS.part 5359782e1eb6f449338f18e053ad82f25382d968690208ae5739d9338eb7bdc7 guix-build-58a9601dffa6/output/x86_64-w64-mingw32/bitcoin-58a9601dffa6-win64-debug.zip 0d387d5a4cb1d712556a3fe5b4bd1e928bb5fbbe57a85ee06c746f132a6b1ec5 guix-build-58a9601dffa6/output/x86_64-w64-mingw32/bitcoin-58a9601dffa6-win64-setup-unsigned.exe dbfd7419d1d764e853a9dc041e276669b488aea4a80e21e4a175b6c3e512e70c guix-build-58a9601dffa6/output/x86_64-w64-mingw32/bitcoin-58a9601dffa6-win64-unsigned.tar.gz 0ba07504d9d5a12af9144e8b386b2640b48dba067d47c694a44ecffe56b0c0fc guix-build-58a9601dffa6/output/x86_64-w64-mingw32/bitcoin-58a9601dffa6-win64.zip ``` ACKs for top commit: laanwj: Code review ACK 58a9601dffa6d9b3b881a476169458787d382919 Tree-SHA512: d1c22b3d0d21ef8f9f605ef6ca06353e3f48536d84f3531f93d613a6ccbbe62f12fae0ed09e8b9a8940b0ef33f9d41d9991eb56fbe7c4ab48f0ce7fcf44e08b1
2022-06-21Merge bitcoin-core/gui#612: refactor: Drop unused `QFrame`s in `SendCoinsEntry`Hennadii Stepanov
7ab72b9d2a500420a1103221c3cbfac4cda1c43a qt: Fix `BitcoinAmountField`'s base widget (Hennadii Stepanov) 32625421047951b9c9fad195be3aa40d6075d469 qt, refactor: Fix `sendcoinsentry.ui` indentation (Hennadii Stepanov) f3c76033295b8007c61eab7fcb23cf119d72b8b8 qt, refactor: Convert `SendCoinsEntry` to a sub-`QWidget` (Hennadii Stepanov) 6420fb2005db1490d77c6df45d0b97d7389ff609 qt, refactor: Drop unused `QFrame`s in `SendCoinsEntry` (Hennadii Stepanov) Pull request description: The `SendCoins_UnauthenticatedPaymentRequest` and `SendCoins_AuthenticatedPaymentRequest` sub-`QFrame`'s of the `SendCoinsEntry` widget have been unused since bitcoin/bitcoin#17165. Removed all dead code. The resulted `SendCoinsEntry` widget has been simplified. ACKs for top commit: w0xlt: Tested ACK https://github.com/bitcoin-core/gui/pull/612/commits/7ab72b9d2a500420a1103221c3cbfac4cda1c43a shaavan: reACK 7ab72b9d2a500420a1103221c3cbfac4cda1c43a Tree-SHA512: a46db90d60fae584b52cc7edae910c295351cb3627e04d225708c50c04f7fdd81d2755e055115612a12a3c841e78c31bdcd57bed9feb1d3909f7a2f6e76bd356
2022-06-21Merge bitcoin-core/gui#615: If -prune=0 is set, Uncheck Prune on Intro pageHennadii Stepanov
40566e21c02ddec6458cd83fa76fea081c5469dc If -prune=0 is set, Uncheck Prune on Intro page (Jadi) Pull request description: If the bitcoin-qt is started with -prune=0 arg, On the Intro page, the Prune Checkbox will be unchecked too, to prevent confusions. refs: https://github.com/bitcoin/bitcoin/issues/25052 ACKs for top commit: hebasto: re-ACK 40566e21c02ddec6458cd83fa76fea081c5469dc Tree-SHA512: d5e0b76a7d20ae806e61a416fd907650f15a744a5823d0f8b57a634cb099bb135199e69a787bd54ecde2cf84e95633f40ff407a722350f337b27de395a6e0f78
2022-06-20Merge bitcoin/bitcoin#25118: wallet: unify “allow/block other inputs“ ↵laanwj
concept d33871288636d9e4cdde2e1430de1f4223e2dd3f scripted-diff: rename fAllowOtherInputs -> m_allow_other_inputs (furszy) 8dea74a8ff8f5d3fdf6602c0eaa0fcc5877fc569 refactor: use GetWalletTx in SelectCoins instead of access mapWallet (furszy) b4e2d4d4eea5f53aeb3124f966157222ea91106b wallet: move "use-only coinControl inputs" below the selected inputs lookup (furszy) 25749f1df77c78eb146978ca0485cf9f91b5ce49 wallet: unify “allow/block other inputs“ concept (furszy) Pull request description: Seeking to make the `CoinControl` options less confusing/redundant. It should have no functional changes. The too long to read technical description; remove `m_add_inputs`, we can use the already existent `fAllowOtherInputs` flag. In #16377 the `CoinControl` flag ‘m_add_inputs’ was added to tell the coin filtering and selection process two things: - Coin Filtering: Only use the provided inputs. Skip the Rest. - Coin Selection: Search the wtxs-outputs and append all the `CoinControl` internal and external selected outpoints to the selection result (skipping all the available output checks). Nothing else. Meanwhile, in `CoinControl` we already have a flag ‘fAllowOtherInputs’ which is already saying: - Coin Filtering: Only use the provided inputs. Skip the Rest. - Coin Selection: If false, no selection process -> append all the `CoinControl` selected outpoints to the selection result (while they passed all the `AvailableCoins` checks and are available in the 'vCoins' vector). ### Changes As can notice, the first point in the coin filtering process is duplicated in the two option flags. And the second one, is slightly different merely because it takes into account whether the coin is on the `AvailableCoins` vector or not. So it makes sense to merge ‘m_add_inputs’ and ‘fAllowOtherInputs’ into a single field for the coin filtering process while introduce other changes to add the missing/skipped internal and external coins into 'vCoins' vector if they were manually selected by the user. —————————————————————————————————— Just as an extra note: On top of this, I’m working on unifying/untangling further the coin filtering and selection processes so we have less duplicate functionality in both processes. ACKs for top commit: laanwj: Code review ACK d33871288636d9e4cdde2e1430de1f4223e2dd3f Tree-SHA512: 98920b80dd787cfe737dacd4c59575dfa8393c799b55f2aaef9aed2b15c61470715a88663557b49c7400938220f99af7690be01980a8684f4f71947407f21750
2022-06-20wallet: avoid extra wtx lookup in AddToSpendsfurszy
This method is only called from AddToWallet and LoadToWallet, places where we already have the wtx.
2022-06-20net: remove CloseSocket()Vasil Dimov
Do the closing in `Sock::Reset()` and remove the standalone `CloseSocket()`. This reduces the exposure of low-level sockets (i.e. integer file descriptors) outside of the `Sock` class.
2022-06-20net: remove now unused Sock::Release()Vasil Dimov
2022-06-20build: globally define NOMINMAXfanquake
Define (and document) `NOMINMAX` once, rather than across multiple source files. Defining this prevents the definition of min/max macros when using mingw-w64, which may conflict with unprefixed std::min/max usage. While that might not be the case for us, we'd always prefer to use the standard library in any case. For example: https://github.com/mingw-w64/mingw-w64/blob/73cadc06c62c6af5faf76f64ef08e684b48de48c/mingw-w64-headers/include/ntdef.h#L289-L300
2022-06-20refactor: move DEFAULT_*_LIMIT assertions from validation to policyfanquake
2022-06-20refactor: move EXTRA_DESCENDANT_TX_SIZE_LIMIT to policy/policy.hfanquake
2022-06-20refactor: use braced initialization in policy/policy.hfanquake
2022-06-20scripted-diff: use static constexpr in policy/policy.hfanquake
-BEGIN VERIFY SCRIPT- sed -i -e "s/static const /static constexpr /" src/policy/policy.h -END VERIFY SCRIPT-
2022-06-20refactor: Move DEFAULT_DESCENDANT_SIZE_LIMIT to policy/policy.hfanquake
2022-06-20refactor: Move DEFAULT_DESCENDANT_LIMIT to policy/policy.hfanquake
2022-06-20refactor: Move DEFAULT_ANCESTOR_SIZE_LIMIT to policy/policy.hfanquake
2022-06-20refactor: Move DEFAULT_ANCESTOR_LIMIT to policy/policy.hCAnon
2022-06-19scripted-diff: rename fAllowOtherInputs -> m_allow_other_inputsfurszy
-BEGIN VERIFY SCRIPT- sed -i 's/fAllowOtherInputs/m_allow_other_inputs/g' -- $(git grep --files-with-matches 'fAllowOtherInputs') -END VERIFY SCRIPT-