aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-09-19Merge bitcoin/bitcoin#26005: Wallet: Fix error handling (copy_file failure ↵fanquake
in RestoreWallet, and in general via interfaces) c3e536555aa3a7db773170671da1256a2ace2094 Bugfix: Wallet: Return util::Error rather than non-error nullptr when CreateWallet/LoadWallet/RestoreWallet fail (Luke Dashjr) 335ff98c8a64eda38a2a2334102bd253f108c253 Bugfix: Wallet: Wrap RestoreWallet content in a try block to ensure exceptions become returned errors and incomplete wallet directory is removed (Luke Dashjr) Pull request description: Bug 1: `copy_file` can throw exceptions, but `RestoreWallet` is expected to return a nullptr with a populated `errors` parameter. This is fixed by wrapping `copy_file` and `LoadWallet` (for good measure) in a `try` block, and converting any exceptions to the intended return style. Bug 2: `util::Result` turns what would have been a `false` unique_ptr into a `true` nullptr result, which leads to nullptr dereferences in at least the 3 cases of wallet creation/loading/restoring. This is fixed by keeping the pointer as a plain `std::unique_ptr` until actually returning it (ie, after the nullptr check). Fixes https://github.com/bitcoin-core/gui/issues/661 ACKs for top commit: achow101: ACK c3e536555aa3a7db773170671da1256a2ace2094 Tree-SHA512: 4291b3dbbb147acea2e63a704324c9371bc16ecb4237f8753729b0b0a6e55c9758ad61bfe8bd432fd7b0bae95d8b63a9831e61ac8b8d5c0197b550a2e0f4a105
2022-09-17Make miniscript string parsing account for exact script size as boundPieter Wuille
Co-Authored-by: Antoine Poinsot <darosior@protonmail.com>
2022-09-17Permit delaying duplicate key check in miniscript::Node constructionPieter Wuille
2022-09-16Bugfix: Wallet: Return util::Error rather than non-error nullptr when ↵Luke Dashjr
CreateWallet/LoadWallet/RestoreWallet fail
2022-09-16Bugfix: Wallet: Wrap RestoreWallet content in a try block to ensure ↵Luke Dashjr
exceptions become returned errors and incomplete wallet directory is removed
2022-09-16Merge bitcoin/bitcoin#26087: build: prune BOOST_CPPFLAGS from libbitcoin_zmqfanquake
a10df7cf351e3947ba2d6cd1357d2c3348f8559a build: prune BOOST_CPPFLAGS from libbitcoin_zmq (fanquake) Pull request description: Rather than including `validation.h`, which ultimately means needing boost via `txmempool.h`, include `primitives/block.h` for `CBlock`, and remove `validation.h`, as we can get `cs_main` from `node/blockstorage.h`. ACKs for top commit: theuni: Nice. ACK a10df7cf351e3947ba2d6cd1357d2c3348f8559a. hebasto: ACK a10df7cf351e3947ba2d6cd1357d2c3348f8559a, tested on Linux x86_64 using theuni's [patch](https://github.com/theuni/bitcoin/commit/e131d8f1e33baa9a9499d2e1a4a99b171566c5a5) with depends. Tree-SHA512: 792b6f9e7e7788d10333b4943609efbc798f3b187c324a0f2d5acbb2d44e3c67705dc54d698eb04c23e5af7b8b73a47f8e7974e819eac12f12ae62f28c807476
2022-09-16Merge bitcoin/bitcoin#26086: build: remove BOOST_CPPFLAGS usage from bitcoin-txfanquake
f839697d9b89002d020997154e182ddb4dccf45b build: remove BOOST_CPPFLAGS usage from bitcoin-tx (fanquake) Pull request description: The only reason `BOOST_CPPFLAGS` was needed here, is because of the `policy/rbf.h` include, which ultimately includes boost multi_index via `txmempool.h`. However this include is unused. ACKs for top commit: theuni: Nice. ACK f839697d9b89002d020997154e182ddb4dccf45b. hebasto: ACK f839697d9b89002d020997154e182ddb4dccf45b, tested on Linux x86_64 using theuni's [patch](https://github.com/theuni/bitcoin/commit/e131d8f1e33baa9a9499d2e1a4a99b171566c5a5) with depends. Tree-SHA512: ec93f4045d927789d70e2a96a6869c0df63891483bb61361327bfefafaabc2925f63382aa3d9302963df2306bc035edad4cabd5eeb315db6603266e677be7cd3
2022-09-16Merge bitcoin/bitcoin#25971: refactor: Use std::string for thread and index ↵MacroFake
names 26cf9ea8e44d7fd6450336f567afaedd1275baf7 scripted-diff: rename pszThread to thread_name (stickies-v) 200d84d5681918523d982b9ddf60d1127edcb448 refactor: use std::string for index names (stickies-v) 97f5b20c12ca6ccf89d7720a5d41eaf4cda1b695 refactor: use std::string for thread names (stickies-v) Pull request description: As a follow-up to https://github.com/bitcoin/bitcoin/pull/25967#discussion_r959637189, this PR changes the return type of [`BaseIndex::GetName()`](https://github.com/bitcoin/bitcoin/blob/fa5c224d444802dabec5841009e029b9754c92f1/src/index/base.h#L120) to `const std::string&` instead of `const char*`. The first commit is not essential for this change, but since the code is touched and index names are commonly used to specify thread names, I've made the same update there. No behaviour change, just refactoring to further phase out C-style strings. Note: `util::ThreadRename()` used to take an rvalue ref, but since it then passes this to `SetInternalName()` by value, I don't think there's any benefit to having both an rvalue and lvalue ref function so I just changed it into lvalue ref. Not 100% sure I'm missing something? ACKs for top commit: MarcoFalke: review ACK 26cf9ea8e44d7fd6450336f567afaedd1275baf7 only change is new scripted-diff 😀 hebasto: ACK 26cf9ea8e44d7fd6450336f567afaedd1275baf7, I have reviewed the code and it looks OK. w0xlt: reACK https://github.com/bitcoin/bitcoin/pull/25971/commits/26cf9ea8e44d7fd6450336f567afaedd1275baf7 Tree-SHA512: 44a03ebf2bb86ca1411a36222a575217cdba8ee3a3c985e74d74c934516f002b27336147fa22f59eda7dac21204a93951563317005d475da95b23c427014d77b
2022-09-16Merge bitcoin/bitcoin#25499: Use steady clock for all millis bench loggingfanquake
fa521c960337a65d4ce12cd1ef009c652ffe57e6 Use steady clock for all millis bench logging (MacroFake) Pull request description: Currently `GetTimeMillis` is used for bench logging in milliseconds integral precision. Replace it to use a steady clock that is type-safe and steady. Microsecond or float precision can be done in a follow-up. ACKs for top commit: fanquake: ACK fa521c960337a65d4ce12cd1ef009c652ffe57e6 - started making the same change. Tree-SHA512: 86a810e496fc663f815acb8771a6c770331593715cde85370226685bc50c13e8e987e3c5efd0b4e48b36ebd2372255357b709204bac750d41e94a9f7d9897fa6
2022-09-16Merge bitcoin/bitcoin#26105: Use ReadLE64 in uint256::GetUint64 instead of ↵fanquake
duplicating logic 04fee75bacb9ec3bceff1246ba6c8ed8a8759548 Use ReadLE64 in uint256::GetUint64() instead of duplicating logic (Pieter Wuille) Pull request description: No need to have a (naive) copy of the `ReadLE64` logic inside `uint256::GetUint64`, when we have an optimized function for exactly that. ACKs for top commit: davidgumberg: ACK 04fee75bacb9ec3bceff1246ba6c8ed8a8759548 jonatack: ACK 04fee75bacb9ec3bceff1246ba6c8ed8a8759548 review, this use of ReadLE64() is similar to the existing invocation by Num3072::Num3072(), sanity checked that before and after this change GetUint64() returns the same result (debug build, clang 13) Tree-SHA512: 0fc2681536a18d82408411bcc6d5c6445fb96793fa43ff4021cd2933d46514c725318da35884f428d1799023921f33f8af091ef428ceb96a50866ac53a345356
2022-09-16Merge bitcoin/bitcoin#26065: i2p: use the same destination type for ↵fanquake
transient and persistent addresses 8b2891a6d10f4a3875010d2e8eafd78bcf378952 i2p: use the same destination type for transient and persistent addresses (Vasil Dimov) Pull request description: We generate our persistent I2P address with type `EdDSA_SHA512_Ed25519` (`DEST GENERATE SIGNATURE_TYPE=7`). Use the same type for our transient addresses which are created by the `SESSION CREATE ...` command. If not specified, then the default one is `DSA_SHA1` according to https://geti2p.net/en/docs/api/samv3. Fixes https://github.com/bitcoin/bitcoin/issues/26062 ACKs for top commit: mzumsande: ACK 8b2891a6d10f4a3875010d2e8eafd78bcf378952 sipa: utACK 8b2891a6d10f4a3875010d2e8eafd78bcf378952; didn't test but verified this matches the documentation Tree-SHA512: 1b10e7e1e274b77609d08ee9cf9d73fef8c975c51aec452ce23e15fcf41709398c697087bfdece121b1fd26bc0501fc45857a91aaab679cadd0cbb37dd94c3a7
2022-09-15Use ReadLE64 in uint256::GetUint64() instead of duplicating logicPieter Wuille
2022-09-15Merge bitcoin/bitcoin#26024: wallet: fix sendall creates tx that fails ↵Andrew Chow
tx-size check cc434cbf583ec8d1b0f3aa504417231fdc81f33a wallet: fix sendall creates tx that fails tx-size check (kouloumos) Pull request description: Fixes https://github.com/bitcoin/bitcoin/issues/26011 The `sendall` RPC doesn't use `CreateTransactionInternal` as the rest of the wallet RPCs. [This has already been discussed in the original PR](https://github.com/bitcoin/bitcoin/pull/24118#issuecomment-1029462114). By not going through that path, it never checks the transaction's weight against the maximum tx weight for transactions we're willing to relay. https://github.com/bitcoin/bitcoin/blob/447f50e4aed9a8b1d80e1891cda85801aeb80b4e/src/wallet/spend.cpp#L1013-L1018 This PR adds a check for tx-size as well as test coverage for that case. _Note: It seems that the test takes a bit of time on slower machines, I'm not sure if dropping it might be for the better._ ACKs for top commit: glozow: re ACK cc434cb via range-diff. Changes were addressing https://github.com/bitcoin/bitcoin/pull/26024#discussion_r971325299 and https://github.com/bitcoin/bitcoin/pull/26024#discussion_r970651614. achow101: ACK cc434cbf583ec8d1b0f3aa504417231fdc81f33a w0xlt: reACK https://github.com/bitcoin/bitcoin/pull/26024/commits/cc434cbf583ec8d1b0f3aa504417231fdc81f33a Tree-SHA512: 64a1d8f2c737b39f3ccee90689eda1dd9c1b65f11b2c7bc0ec8bfe72f0202ce90ab4033bb0ecfc6080af8c947575059588a00938fe48e7fd553f7fb5ee03b3cc
2022-09-15Merge bitcoin/bitcoin#26091: test: Fix syncwithvalidationinterfacequeue callsAndrew Chow
fa1ce96184a1815f453e64e14d77cb0025800be9 test: Add missing syncwithvalidationinterfacequeue (MacroFake) faa4916529699f9a057e2bf2459d957bcec1de84 test/doc: Remove unused syncwithvalidationinterfacequeue (MacroFake) Pull request description: Fixes #26071 ACKs for top commit: achow101: ACK fa1ce96184a1815f453e64e14d77cb0025800be9 glozow: ACK fa1ce96184a1815f453e64e14d77cb0025800be9 w0xlt: ACK https://github.com/bitcoin/bitcoin/commit/fa1ce96184a1815f453e64e14d77cb0025800be9 Tree-SHA512: d1e101b55477360ead2b99ade5d42b922aabe293ec84fb26764e29161c5be6c534aef6f22d2cc5ea63a4bd6b6e77b701f1a7a2283b8e7e815d343a604cd77656
2022-09-15Merge bitcoin/bitcoin#26090: fs: fully initialize `_OVERLAPPED` for win32fanquake
02c9e564687af6ae2b0b6589108d502963f879cb fs: fully initialize _OVERLAPPED for win32 (Cory Fields) Pull request description: ```bash fs.cpp: In member function ‘bool fsbridge::FileLock::TryLock()’: fs.cpp:129:32: error: missing initializer for member ‘_OVERLAPPED::InternalHigh’ [-Werror=missing-field-initializers] 129 | _OVERLAPPED overlapped = {0}; | ^ fs.cpp:129:32: error: missing initializer for member ‘_OVERLAPPED::<anonymous>’ [-Werror=missing-field-initializers] fs.cpp:129:32: error: missing initializer for member ‘_OVERLAPPED::hEvent’ [-Werror=missing-field-initializers] ``` Came up in #25972. That PR is now rebased on this change. Closes: #26006 ACKs for top commit: sipsorcery: tACK 02c9e564687af6ae2b0b6589108d502963f879cb. hebasto: ACK 02c9e564687af6ae2b0b6589108d502963f879cb, tested on Linux x86_64: Tree-SHA512: 6a0495c34bd952b2bb8c994a1450da7d3eee61225bb4ff0ce009c013f5e29dba94bb1c3ecef9989dc18c939909fdc8eba690a38f96da431ae9d64c23656de7d0
2022-09-15wallet: fix sendall creates tx that fails tx-size checkkouloumos
The `sendall` RPC doesn't use `CreateTransactionInternal`as the rest of the wallet RPCs and it never checks against the tx-size mempool limit. Add a check for tx-size as well as test coverage for that case.
2022-09-15build: remove unused libevent cppflagsfanquake
2022-09-15build: remove unused natpmp / upnp cppflagsfanquake
Their inclusion is likely just the result of copy-paste. The only place upnp/natpmpflags should be used is `libbitcoin_node` (mapport.cpp).
2022-09-15test: Add missing syncwithvalidationinterfacequeueMacroFake
2022-09-15Merge bitcoin/bitcoin#26084: sendall: check if the maxtxfee has been exceededMacroFake
6f8e3818af7585b961039bf0c768be2e4ee44e0f sendall: check if the maxtxfee has been exceeded (ishaanam) Pull request description: Previously the `sendall` RPC didn't check whether the fees of the transaction it creates exceed the set `maxtxfee`. This PR adds this check to `sendall` and a test case for it. ACKs for top commit: achow101: ACK 6f8e3818af7585b961039bf0c768be2e4ee44e0f Xekyo: ACK 6f8e3818af7585b961039bf0c768be2e4ee44e0f glozow: Concept ACK 6f8e3818af7585b961039bf0c768be2e4ee44e0f. The high feerate is unlikely but sendall should respect the existing wallet options. Tree-SHA512: 6ef0961937091293d49be16f17e4451cff3159d901c0c7c6e508883999dfe0c20ed4d7126bf74bfea8150d4c1eef961a45f0c28ef64562e6cb817fede2319f1a
2022-09-14Merge bitcoin/bitcoin#26053: rpc: bugfix, 'add_inputs' default value is true ↵Andrew Chow
unless 'inputs' are provided b00fc44ca5cb938f18d31cde7feb4e1c968dcc2f test: add coverage for 'add_inputs' dynamic default value (furszy) ddbcfdf3d050061f4e8979a0e2bb63bba5a43c47 RPC: bugfix, 'add_inputs' default value is true unless 'inputs' are provided (furszy) Pull request description: This bugfix was meant to be in #25685, but decoupled it to try to make it part of 24.0 release. It's a truly misleading functionality. This PR doesn't change behavior in any way. Just fixes two invalid RPC help messages and adds test coverage for the current behavior. #### Description In both RPC commands `send()` and `walletcreatefundedpsbt` the help message says that `add_inputs` default value is false when it's actually dynamically set by the following statement: ```c++ coin_control.m_allow_other_inputs = rawTx.vin.size() == 0; ``` Which means that, by default, `add_inputs` is true unless there is any pre-set input, in which case, the default is false. ACKs for top commit: achow101: ACK b00fc44ca5cb938f18d31cde7feb4e1c968dcc2f S3RK: ACK b00fc44ca5cb938f18d31cde7feb4e1c968dcc2f Tree-SHA512: 5c68a40d81c994e0ab6de0817db69c4d3dea3a9a64a60362531bf583b7a4c37d524b740905a3f3a89cdbf221913ff5b504746625adb8622788aea93a35bbcd40
2022-09-14qt: Update translation source file for string freeze (round 2)Hennadii Stepanov
2022-09-14Merge bitcoin-core/gui#664: Prevent wrong handling of `%2` token by TransifexHennadii Stepanov
8ed2b72767de55dce033d8bfe6f9414ae14e1452 qt: Prevent wrong handling of `%2` token by Transifex (Hennadii Stepanov) Pull request description: On master (124e75a41ea0f3f0e90b63b0c41813184ddce2ab), Transifex translation check fails for https://github.com/bitcoin-core/gui/blob/124e75a41ea0f3f0e90b63b0c41813184ddce2ab/src/qt/forms/intro.ui#L206 with a message: > The expression '%2G' is not present in the translation. In "Organization Settings" --> ["Translation checks"](https://www.transifex.com/bitcoin/settings/validations/) I have changed the status of the "**Variable substitution specifiers (like "%s") are preserved in the translations.**" check from "error" to "warning" temporarily. This setting should be reverted after applying this PR change. [Noted](https://www.transifex.com/bitcoin/bitcoin/translate/#ru/qt-translation-024x/436102928/) by Transifex user [AHOHNMYC](https://www.transifex.com/user/profile/AHOHNMYC/). I faced the same issue while working on Ukrainian translation. ACKs for top commit: katesalazar: ACK 8ed2b72767de55dce033d8bfe6f9414ae14e1452 jarolrod: ACK 8ed2b72767de55dce033d8bfe6f9414ae14e1452 Tree-SHA512: 304f795ac9241ac8453c614ed18d967226d9d515f9ea079b51af5bcbe2f0760ca7dcaea5efb38207720cb7a18159c2bcd337b961bc522a128715c70e0db81061
2022-09-14Merge bitcoin-core/gui#663: Cleanup translation commentHennadii Stepanov
5f28fc81600736d499391c4cb6dc34ece5d4229c qt: Cleanup translation comment (Hennadii Stepanov) Pull request description: An unneeded character slipped in bitcoin-core/gui#629. ACKs for top commit: jarolrod: ACK 5f28fc81600736d499391c4cb6dc34ece5d4229c jonatack: utACK 5f28fc81600736d499391c4cb6dc34ece5d4229c Tree-SHA512: 210fb626e8035786cf6859160c60b2815c813e02908c75efc71a2c64d511edd6f81b2f67f1c98b29122b990260ebf663da445ea2d01b6268e3e046ada1ca5b6e
2022-09-14test/doc: Remove unused syncwithvalidationinterfacequeueMacroFake
See https://github.com/bitcoin/bitcoin/pull/25768#discussion_r958562071 Also fix doc typo from https://github.com/bitcoin/bitcoin/pull/25768#discussion_r958571943
2022-09-14Merge bitcoin/bitcoin#25831: refactor: Remove trailing semicolon from LOCK2 ↵MacroFake
macro 0f0cc05e4cf6ccdd514a23d8aa916942dfc1e352 refactor: Remove trailing semicolon from LOCK2 (Aurèle Oulès) Pull request description: Macros should not have a trailing semi-colon to avoid empty statements when using them with another semi-colon. Noticed this while reviewing a PR. ACKs for top commit: vasild: ACK 0f0cc05e4cf6ccdd514a23d8aa916942dfc1e352 Tree-SHA512: 97fa4d89f5131ac30e05b293f750b757d5526feed56885c6feeb403b3ac3d3d3205874bc507c3b56a8296a6e3bdc8d879b2c339784f1e6ab1963d1b8a8d7b02f
2022-09-14fs: fully initialize _OVERLAPPED for win32Cory Fields
2022-09-14scripted-diff: rename pszThread to thread_namestickies-v
Since it is now a string_view instead of a const char*, update the name to reflect that the variable is no longer a "Pointer to String, Zero-terminated" (psz). -BEGIN VERIFY SCRIPT- sed -i s/pszThread/thread_name/ $(git grep -l pszThread src) -END VERIFY SCRIPT-
2022-09-14build: prune BOOST_CPPFLAGS from libbitcoin_zmqfanquake
Rather than including validation.h, which ultimately means needing boost via txmempool.h, include primitives/block.h for CBlock, and remove validation.h, as we can get cs_main from node/blockstorage.h.
2022-09-14build: remove BOOST_CPPFLAGS usage from bitcoin-txfanquake
The only reason BOOST_CPPFLAGS is needed here, is because of the policy/rbf.h include, which ultimately includes boost multi_index via txmempool.h. However this include is actually unused.
2022-09-13sendall: check if the maxtxfee has been exceededishaanam
2022-09-13RPC: bugfix, 'add_inputs' default value is true unless 'inputs' are providedfurszy
In both RPC commands `send()` and `walletcreatefundedpsbt` the RPC help was saying that `add_inputs` default value was false when it's actually dynamically set by the following statement: `coin_control.m_allow_other_inputs = rawTx.vin.size() == 0;` Which means that, by default, `add_inputs` is true unless there was any pre-set input, in which case, the default is false.
2022-09-13refactor: use std::string for index namesstickies-v
2022-09-13refactor: use std::string for thread namesstickies-v
2022-09-13build: extract $(BOOST_CPPFLAGS) from $(BITCOIN_INCLUDES)fanquake
This leaves $(BITCOIN_INCLUDES) as internal dependencies, and gives finer control over Boost includes.
2022-09-13Merge bitcoin/bitcoin#26021: wallet: bugfix, load a wallet with an ↵Andrew Chow
unknown/corrupt descriptor causes a fatal error e06676377d935c69f0ee51fc18eb0772d524aba5 wallet: coverage for loading an unknown descriptor (furszy) d26c3cc44438ecb9e4f618a2427c3c92a292aa16 wallet: bugfix, load wallet with an unknown descriptor cause fatal error (furszy) Pull request description: Fixes #26015 If the descriptor entry is unrecognized (due a soft downgrade) or corrupt, the unserialization fails and `LoadWallet`, instead of stop there and return the error, continues reading all the db records. As other records tied to the unrecognized or corrupt descriptor are scanned, a fatal error is being thrown. This fixes it by catching the descriptor parse failure and return which wallet failed. Logging its name/path, so the user can remove it from the settings file, to prevent its load at startup. Note: added the test in a separate file intentionally. Will continue adding coverage for the wallet load process in follow-up PRs. ACKs for top commit: achow101: ACK e06676377d935c69f0ee51fc18eb0772d524aba5 Sjors: re-utACK e06676377d935c69f0ee51fc18eb0772d524aba5 Tree-SHA512: d1f1a5d7e944c89c97a33b25b4411a36a11edae172c22f8524f69c84a035f84c570b284679f901fe60f1300f781b76a6c17b015a8e7ad44ebd25a0c295ef260f
2022-09-13Merge bitcoin/bitcoin#24513: CChainState -> Chainstateglozow
00eeb31c7660e2c28f189f77a6905dee946ef408 scripted-diff: rename CChainState -> Chainstate (James O'Beirne) Pull request description: Alright alright alright, I know: we hate refactors. We especially hate cosmetic refactors. Nobody knows better than I that changing broad swaths of code out from under our already-abused collaborators, only to send a cascade of rebase bankruptcies, is annoying at best and sadistic at worst. And for a rename! The indignation! But just for a second, imagine yourself. Programming `bitcoin/bitcoin`, on a sandy beach beneath a lapis lazuli sky. You go to type the name of what is probably the most commonly used data structure in the codebase, and you *only hit shift once*. What could you do in such a world? You could do anything. [The only limit is yourself.](https://zombo.com/) --- So maybe you like the idea of this patch but really don't want to deal with rebasing. You're in luck! Here're the commands that will bail you out of rebase bankruptcy: ```sh git rebase -i $(git merge-base HEAD master) \ -x 'sed -i "s/CChainState/Chainstate/g" $(git ls-files | grep -E ".*\.(py|cpp|h)$") && git commit --amend --no-edit' # <commit changed?> git add -u && git rebase --continue ``` --- ~~Anyway I'm not sure how serious I am about this, but I figured it was worth proposing.~~ I have decided I am very serious about this. Maybe we can have nice things every once in a while? ACKs for top commit: MarcoFalke: cr ACK 00eeb31c7660e2c28f189f77a6905dee946ef408 hebasto: ACK 00eeb31c7660e2c28f189f77a6905dee946ef408 glozow: ACK 00eeb31c7660e2c28f189f77a6905dee946ef408, thanks for being the one to propose this w0xlt: ACK https://github.com/bitcoin/bitcoin/pull/24513/commits/00eeb31c7660e2c28f189f77a6905dee946ef408 Tree-SHA512: b828a99780614a9b74f7a9c347ce0687de6f8d75232840f5ffc26e02bbb25a3b1f5f9deabbe44f82ada01459586ee8452a3ee2da05d1b3c48558c8df6f49e1b1
2022-09-13Merge bitcoin/bitcoin#25222: refactor: Pass reference to LookUpStatsMacroFake
faa3d38ec6f2999740486c6c66cd062e74c769fb refactor: Pass reference to LookUpStats (MacroFake) Pull request description: I find it confusing to have an interface that accepts nullptr, but immediately crashes the program when someone does pass nullptr. Fix that. Also some include fixups. ACKs for top commit: aureleoules: ACK faa3d38ec6f2999740486c6c66cd062e74c769fb Tree-SHA512: f90b649e9991e137b83a9899258ee73605719c081a6b789ac27fe7fe73eb70fbb41d89479bcd536d5c3ad788a5795de8451bc1b94e5c9267dcf9636d9e4a1109
2022-09-13Merge bitcoin/bitcoin#24991: init: allow startup with -onlynet=onion ↵fanquake
-listenonion=1 2d0b4e4ff66e60c85f86c526a53f8fb242ebb7d0 init: allow startup with -onlynet=onion -listenonion=1 (Vasil Dimov) Pull request description: It does not make sense to specify `-onlynet=onion` without providing a Tor proxy (even if other `-onlynet=...` are given). This is checked during startup. However, it was forgotten that a Tor proxy can also be retrieved from "Tor control" to which we connect if `-listenonion=1`. So, the full Tor proxy retrieval logic is: 1. get it from `-onion` 2. get it from `-proxy` 3. if `-listenonion=1`, then connect to "Tor control" and get the proxy from there (was forgotten before this change) Fixes https://github.com/bitcoin/bitcoin/issues/24980 ACKs for top commit: mzumsande: Tested ACK 2d0b4e4ff66e60c85f86c526a53f8fb242ebb7d0 MarcoFalke: ACK 2d0b4e4ff66e60c85f86c526a53f8fb242ebb7d0 🕸 Tree-SHA512: d1d18e07a8a40a47b7f00c31cb291a3d3a9b24eeb28c5e4720d5df4997f488583a3a010d46902b4b600d2ed1136a368e1051c133847ae165e0748b8167603dc3
2022-09-12RPC: unify arg type error messagefurszy
We were throwing two different errors for the same problematic: * "Expected type {expected], got {type}" --> RPCTypeCheckArgument() * "JSON value of type {type} is not of expected type {expected}" --> UniValue::checkType()
2022-09-12i2p: use the same destination type for transient and persistent addressesVasil Dimov
We generate our persistent I2P address with type `EdDSA_SHA512_Ed25519` (`DEST GENERATE SIGNATURE_TYPE=7`). Use the same type for our transient addresses which are created by the `SESSION CREATE ...` command. If not specified, then the default one is `DSA_SHA1` according to https://geti2p.net/en/docs/api/samv3.
2022-09-12Merge bitcoin/bitcoin#26048: mempool clean up: replace update_* structs with ↵MacroFake
lambdas 1b348d2725f6271d7f78b4668ab35014cdb176be [mempool] replace update_descendant_state with lambda (glozow) Pull request description: These were introduced in commit https://github.com/bitcoin/bitcoin/commit/5add7a74a672cb12b0a2a630d318d9bc64dd0f77, when the codebase was pre-C++11. We can use lambdas now. ACKs for top commit: MarcoFalke: review ACK 1b348d2725f6271d7f78b4668ab35014cdb176be 👮 w0xlt: ACK https://github.com/bitcoin/bitcoin/pull/26048/commits/1b348d2725f6271d7f78b4668ab35014cdb176be Tree-SHA512: b664425b395e39ecf1cfc1e731200378261cf58c3985075fdc6027731a5caf995de72ea25be99b4c0dbec2e3ee6cf940e7c577638844619c66c8494ead5da459
2022-09-10Merge bitcoin/bitcoin#26009: test: remove Boost Test from libtest_utilMacroFake
a7dbf74d72abfe74aaeb3c11dbfa98d43b85b4ec test: remove Boost Test from libtest util (fanquake) Pull request description: Context is the discussion here: https://github.com/bitcoin/bitcoin/pull/25974/files#r961541457. Output: ```bash [test/util/chainstate.h:38] [CreateAndActivateUTXOSnapshot] Wrote UTXO snapshot to /var/folders/sq/z88fhjzj0b19ftsd2_bjrmjm0000gn/T/test_common_Bitcoin Core/8f2783bb3dbf10c669cd892192d70efcca4bab250226856fed7ffecdb378ffc7/test_snapshot.100.dat: {"coins_written":100,"base_hash":"571d80a9967ae599cec0448b0b0ba1cfb606f584d8069bd7166b86854ba7a191","base_height":100,"path":"/var/folders/sq/z88fhjzj0b19ftsd2_bjrmjm0000gn/T/test_common_Bitcoin Core/8f2783bb3dbf10c669cd892192d70efcca4bab250226856fed7ffecdb378ffc7/test_snapshot.100.dat","txoutset_hash":"cd1ba1c3f393058ae743b7c6bdbd00c897744cdcf022c9f2f0f2b4565c08a49c","nchaintx":101} ``` ACKs for top commit: Sjors: tACK a7dbf74 theuni: ACK a7dbf74d72abfe74aaeb3c11dbfa98d43b85b4ec Tree-SHA512: b9511f88a1a997f44637e3f613a71780026ce519f896af4209b01639883a3b1e40543928b213935c63d3e64c1813e9960a9004e47ed7de6cb7f7e36c33199bcc
2022-09-09wallet: coverage for loading an unknown descriptorfurszy
Previously, this was crashing the wallet.
2022-09-09wallet: bugfix, load wallet with an unknown descriptor cause fatal errorfurszy
If the descriptor entry is unrecognized/corrupt, the unserialization fails and `LoadWallet` instead of stop there and return the error, continues reading all the db records. As other records tied to the unrecognized/corrupted descriptor are scanned, a fatal error is thrown.
2022-09-09scripted-diff: rename CChainState -> ChainstateJames O'Beirne
-BEGIN VERIFY SCRIPT- sed -i 's/CChainState/Chainstate/g' $(git grep -l CChainState ':(exclude)doc/release-notes*') -END VERIFY SCRIPT- Co-authored-by: MacroFake <falke.marco@gmail.com>
2022-09-09Merge bitcoin/bitcoin#26040: doc: comment "add only reachable addresses to ↵MacroFake
addrman" ce4257026622287c8c981fb932681730a3c6387f doc: comment "add only reachable addresses to addrman" (Kristaps Kaupe) Pull request description: Proposed by Sjors during review of #25678, was likely just missed, as it also for me looks a code where comment will not hurt. https://github.com/bitcoin/bitcoin/pull/25678#discussion_r964482832 ACKs for top commit: mzumsande: ACK ce4257026622287c8c981fb932681730a3c6387f vasild: ACK ce4257026622287c8c981fb932681730a3c6387f Zero-1729: re-ACK ce4257026622287c8c981fb932681730a3c6387f Tree-SHA512: ef085d527349de07c1b43ed39e55e34b29cb0137c9509bd14a1af88206f7d4aa7dfec1dca53a9deaed67a2d0f32fa21e0b1a04d4d5d7f8a265dfab3b62bf8c54
2022-09-09[mempool] replace update_descendant_state with lambdaglozow
These were introduced in commit 5add7a7, when the codebase was pre-C++11. They are no longer necessary.
2022-09-09Merge bitcoin/bitcoin#25853: net: update testnet torv3 hardcoded seeds for 24.xMacroFake
2ef33e936eaf1058086169b5833f196ff624bf89 contrib: update testnet torv3 hardcoded seeds (Jon Atack) Pull request description: As a follow-up to https://github.com/bitcoin/bitcoin/issues/13550 and #22060, replace the mostly unreachable testnet torv3 hardcoded seeds from v0.22 with new ones that are consistently reachable recently and that have service bit 1 set. This needs to be done before v24.0 to make sure onion-only testnet nodes can still connect to the network. Ways to test: - Re-generate `src/chainparamsseeds.h` with `cd contrib/seeds && python3 generate-seeds.py . > ../../src/chainparamsseeds.h`, check if git tree stays the same - Re-compile and create a new testnet node with `bitcoind -testnet -dnsseed=0 -onlynet=onion -proxy=127.0.0.1:9050` (or delete `~/.bitcoin/testnet3/peers.dat` and launch bitcoind with `-testnet -dnsseed=0`). Make sure there are no `addnode=` in your `bitcoin.conf`. The debug log should print "Adding fixed seeds". Check if the node is able to connect to the network and get blocks with for ex. `watch -t ./src/bitcoin-cli -testnet -rpcwait -netinfo 4` - Check the addrman contains the seeds by running for ex. `bitcoin-cli -rpcwait -testnet getnodeaddresses 0 onion | jq -r '.[] | (.address + ":" + (.port|tostring) + " " + (.services|tostring))' | sort` - Check if the addresses are connectable, for ex. with this python script by laanwj: ```python3 #!/usr/bin/env python3 import pprint import subprocess with open('contrib/seeds/nodes_test.txt') as f: for line in (line for line in (line.rstrip().split('#', 1)[0] for line in f) if line): pprint.pprint(line) subprocess.call(["nc", "-v", "-x", "127.0.0.1:9050", "-z"] + line.split(':')) ``` Thanks to satsie (Stacie Waleyko) for help with the list. ACKs for top commit: satsie: ACK 2ef33e936eaf1058086169b5833f196ff624bf89 laanwj: ACK 2ef33e936eaf1058086169b5833f196ff624bf89 Tree-SHA512: 72d27ecba243089bd49c11e921855fba626a1e09ae9b17508254a3bbec4bec341ed6c3d5a4eabc2d37f20bafb8a47ecc7d125e0dda956512a9525ad83273ffd6
2022-09-09doc: comment "add only reachable addresses to addrman"Kristaps Kaupe