aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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
2022-09-07Merge bitcoin/bitcoin#25678: p2p: skip querying dns seeds if `-onlynet` ↵fanquake
disables IPv4 and IPv6 385f5a4c3feb716fcf3f2b4823535df6da6bb67b p2p: Don't query DNS seeds when both IPv4 and IPv6 are unreachable (Martin Zumsande) 91f0a7fbb79fe81a75370a4b60dcdd2e55edfa81 p2p: add only reachable addresses to addrman (Martin Zumsande) Pull request description: Currently, `-onlynet` does not work well in connection with initial peer discovery, because DNS seeds only resolve to IPv6 and IPv4 adresses: With `-onlynet=i2p`, we would load clearnet addresses from DNS seeds into addrman, be content our addrman isn't empty so we don't try to query hardcoded seeds (although these exist for i2p!), and never attempt to make an automatic outbound connection. With `-onlynet=onion` and `-proxy` set, we wouldn't load addresses via DNS, but will make AddrFetch connections (through a tor exit node) to a random clearnet peer the DNS seed resolves to (see https://github.com/bitcoin/bitcoin/issues/6808#issuecomment-147652505), thus breaching the `-onlynet` preference of the user - this has been reported in the two issues listed below. This PR proposes two changes: 1.) Don't load addresses that are unreachable (so that we wouldn't connect to them) into addrman. This is already the case for addresses received via p2p addr messages, this PR implements the same for addresses received from DNS seeds and fixed seeds. This means that in the case of `-onlynet=onion`, we wouldn't load fixed seed IPv4 addresses into addrman, only the onion ones. 2.) Skip trying the DNS seeds if neither IPv4 nor IPv6 are reachable and move directly to adding the hardcoded seeds from networks we can connect to. This is done by soft-setting `-dnsseed` to 0 in this case, unless `-dnsseed=1` was explicitly specified, in which case we abort with an `InitError`. Fixes #6808 Fixes #12344 ACKs for top commit: naumenkogs: utACK 385f5a4c3feb716fcf3f2b4823535df6da6bb67b vasild: ACK 385f5a4c3feb716fcf3f2b4823535df6da6bb67b Tree-SHA512: 33a8c29faccb2d9b937b017dba4ef72c10e05e458ccf258f1aed3893bcc37c2e984ec8de998d2ecfa54282abbf44a132e97d98bbcc24a0dcf1871566016a9b91
2022-09-07Merge bitcoin/bitcoin#25983: Prevent data race for `pathHandlers`MacroFake
4296dde28757d88a7076847484669fb202b47bc8 Prevent data race for `pathHandlers` (Hennadii Stepanov) Pull request description: Fixes bitcoin/bitcoin#19341. ACKs for top commit: ryanofsky: Code review ACK 4296dde28757d88a7076847484669fb202b47bc8. This should protect the vector. It also seems to make the http_request_cb callback single threaded, but that seems ok, since it is just adding work queue items not actually processing requests. Tree-SHA512: 1c3183100bbc80d8e83543da090b8f4521921cf30d444e3e4c87102bf7a1e67ccc4dfea7e9990ac49741b2a5708f259f4eced9d4049c20ae4e531461532a6aef
2022-09-07qt: Prevent wrong handling of `%2` token by TransifexHennadii Stepanov
Transifex must expect a `%2` token in the translated string, not a `%2GB` one.
2022-09-07qt: Cleanup translation commentHennadii Stepanov
2022-09-06Merge bitcoin/bitcoin#26010: RPC: fix sendall docsAndrew Chow
51829409967dcfd039249506ecd2c58fb9a74b2f RPC: fix sendall docs (Anthony Towns) Pull request description: Updates the documentation for the "inputs" entry in the "options" parameter of the sendall RPC to match the documentation for createrawtransaction. ACKs for top commit: achow101: ACK 51829409967dcfd039249506ecd2c58fb9a74b2f Xekyo: ACK 51829409967dcfd039249506ecd2c58fb9a74b2f Tree-SHA512: fe78e17b2f36190939b645d7f4653d025bbac110e4a7285b49e7f1da27adac8c4d03fd5b770e3a74351066b1ab87fde36fc796f42b03897e4e2ebef4b6b6081c
2022-09-06p2p: Don't query DNS seeds when both IPv4 and IPv6 are unreachableMartin Zumsande
This happens, for example, if the user specified -onlynet=onion or -onlynet=i2p. DNS seeds only resolve to IPv4 / IPv6 addresses, making their answers useless to us, since we don't want to make connections to these. If, within the DNS seed thread, we'd instead do fallback AddrFetch connections to one of the clearnet addresses the DNS seed resolves to, we might get usable addresses from other networks if lucky, but would be violating our -onlynet user preference in doing so. Therefore, in this case it is better to rely on fixed seeds for networks we want to connect to. Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
2022-09-06p2p: add only reachable addresses to addrmanMartin Zumsande
We will not make outgoing connection to peers that are unreachable (e.g. because of -onlynet configuration). Therefore, it makes no sense to add them to addrman in the first place. While this is already the case for addresses received via p2p addr messages, this commit does the same for addresses received from fixed seeds.
2022-09-06Merge bitcoin/bitcoin#25946: Update chainparams for 24.0 releaseMacroFake
767d825e27b452d6e846280256e5932e906da44d Update chainparams for 24.0 release (Janna) Pull request description: Update chain parameters for upcoming major release. See [doc/release-process.md](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md) and #24418 for review instructions. fixes #25921 ACKs for top commit: Sjors: tACK 767d825e27b452d6e846280256e5932e906da44d achow101: utACK 767d825e27b452d6e846280256e5932e906da44d Tree-SHA512: 153390203c76c981cc41629a27ec3e52fec089c7ce6edba3dd4d77c875c7d8afcae64be2bd9bc8af73f70c2dc0a08666f2986ac82c9fd536b0fded10fd8dec3d
2022-09-06fuzz: Remove no-op call to get()MacroFake
2022-09-05init: allow startup with -onlynet=onion -listenonion=1Vasil Dimov
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