aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-05-30Merge bitcoin/bitcoin#21207: MOVEONLY: CWallet transaction code out of ↵Samuel Dobson
wallet.cpp/.h c7bd5842e467c4fc286399379572bbdec6b26a4f MOVEONLY: CWallet transaction code out of wallet.cpp/.h (Russell Yanofsky) Pull request description: This commit just moves function without making any changes. It can be reviewed with `git log -p -n1 --color-moved=dimmed_zebra` Motivation for this change is to make `wallet.cpp/h` less monolithic and start to make wallet transaction state tracking comprehensible so bugs in https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking can be fixed safely without introducing new problems. This moves wallet classes and methods that deal with transactions out of `wallet.cpp/.h` into better organized files: - `transaction.cpp/.h` - CWalletTx and CMerkleTx class definitions - `receive.cpp/.h` - functions checking received transactions and computing balances - `spend.cpp/.h` - functions creating transactions and finding spendable coins After #20773, when loading is separated from syncing it will also be possible to move more `wallet.cpp/.h` functions to: - `sync.cpp/.h` - functions handling chain notifications and rescanning This commit arranges `receive.cpp` and `spend.cpp` functions in dependency order so it's possible to skim `receive.cpp` and get an idea of how computing balances works, and skim `spend.cpp` and get an idea of how transactions are created, without having to jump all over `wallet.cpp` where functions are not in order and there is a lot of unrelated code. Followup commit "refactor: Detach wallet transaction methods" in https://github.com/bitcoin/bitcoin/pull/21206 follows up this PR and tweaks function names and arguments to reflect new locations. The two commits are split into separate PRs because this commit is more work to maintain and less work to review, while the other commit is less work to maintain and more work to review, so hopefully this commit can be merged earlier. ACKs for top commit: Sjors: re-utACK c7bd5842e467c4fc286399379572bbdec6b26a4f fjahr: utACK c7bd5842e467c4fc286399379572bbdec6b26a4f promag: Code review ACK c7bd5842e467c4fc286399379572bbdec6b26a4f, verified move only claim. meshcollider: Dimmed-zebra-check and functional test run ACK c7bd5842e467c4fc286399379572bbdec6b26a4f Tree-SHA512: 4981de6911cb1196774db375494355cc9af59b52456129c002d264a77cd9ed6175f8ecbb6b2f492a59a4d5a0def21a39d96fa79c9f4d99be0992985f553be32f
2021-05-29Merge bitcoin-core/gui#343: Improve the GUI responsiveness when progress ↵Hennadii Stepanov
dialogs are used 4935ac583bbdc289dd31a1caae3d711edef742b6 qt: Improve GUI responsiveness (Hennadii Stepanov) 75850106aeecfed1d2dc16d8a67ec210c5826a47 qt, macos: Fix GUIUtil::PolishProgressDialog bug (Hennadii Stepanov) Pull request description: [`QProgressDialog`](https://doc.qt.io/qt-5/qprogressdialog.html) estimates the time the operation will take (based on time for steps), and only shows itself if that estimate is beyond [`minimumDuration`](https://doc.qt.io/qt-5/qprogressdialog.html#minimumDuration-prop). The default `minimumDuration` value is [4 seconds](https://doc.qt.io/qt-5/qprogressdialog.html#details), and it could make users think that the GUI is frozen. This PR sets `minimumDuration` to zero for all progress dialogs, that affects ones in the `WalletControllerActivity` class. ACKs for top commit: ryanofsky: Code review ACK 4935ac583bbdc289dd31a1caae3d711edef742b6. I'm not very familiar with this API but all the changes and explanations make sense and are very clear, and this seems like it should be an improvement. promag: Code review ACK 4935ac583bbdc289dd31a1caae3d711edef742b6. jarolrod: ACK 4935ac583bbdc289dd31a1caae3d711edef742b6 Tree-SHA512: 2ddd74e7fd87894d341d2439dbaa544d031a350f7f57d4c7e9fbba977dc24080fe60fd7a80a542b1647f1de9091d7fd04a36eab695088d4d75fb836548e99b5f
2021-05-28Merge bitcoin-core/gui#275: Support runtime appearance adjustment on macOSHennadii Stepanov
c231254a65d390a3350fcef456d57e4a6eca0506 qt: Make TransactionView aware of runtime palette change (Hennadii Stepanov) 2b622d4aced1848393989ee906b1f9d2436f1c1a qt: Make CoinControlDialog aware of runtime palette change (Hennadii Stepanov) 97a6b5e06a532a4ee029c8ba59c3438369f8b049 qt: Make OverviewPage aware of runtime palette change (Hennadii Stepanov) d05f1b278d9846de5142a4ac3f53c84145330dd1 qt: Make UnitDisplayStatusBarControl aware of runtime palette change (Hennadii Stepanov) 6b2ce65392dc98250e84941370e975048b8afc54 qt: Replace base class of ClickableLabel with ThemedLabel (Hennadii Stepanov) ff530a2093c294a1093e1b00fb66ab0a98851c04 qt: Use GUIUtil::ThemedLabel class (Hennadii Stepanov) d99ef327a885874fed1c4e35e0f47b10290c6bd9 qt: Add GUIUtil::ThemedLabel class (Hennadii Stepanov) c054720e08b5549913f54b9b4bc4e4002617ff23 qt: Make SignVerifyMessageDialog aware of runtime palette change (Hennadii Stepanov) 0dcc3fac433b341eb6e1d3a2fb4d2de1595e8e88 qt: Make SendCoinsEntry aware of runtime palette change (Hennadii Stepanov) fa18d28e1242c2948814df1082ee12c2fecf5403 qt: Make RPCConsole aware of runtime palette change (Hennadii Stepanov) f1083826e3e68803da86af6efba21c4080769b5c qt: Make BitcoinGUI aware of runtime palette change (Hennadii Stepanov) ce17861dc419b0d1fc1d933000f484dd08bacf5b qt: Make PlatformStyle aware of runtime palette change (Hennadii Stepanov) Pull request description: On macOS switching appearance (Light -> Dark or Dark -> Light) when Bitcoin Core is running makes the GUI pretty unusable. This bug is especially important when a user chose the "Auto" mode to adjust appearance automatically. This PR fixes Bitcoin Core behavior. This is an alternative to #268. ACKs for top commit: Sjors: tACK c231254a65d390a3350fcef456d57e4a6eca0506 on macOS 11.4 goums: ACK c231254a65d390a3350fcef456d57e4a6eca0506 promag: Tested ACK c231254a65d390a3350fcef456d57e4a6eca0506 on macOS Big Sur arm64. jarolrod: tACK c231254a65d390a3350fcef456d57e4a6eca0506 Tree-SHA512: 122dda3e4c9703f68cec60613c536ca59d04c93f2c03398559f2361b8d279ae534800e8e677d94a33e10e769d00be54295a704e98afa2e986a06146b9f164854
2021-05-28Merge bitcoin/bitcoin#22078: Add src/qt/android/.gitignorefanquake
7d07192ddeaad28a26e3c4a54757a4f27f2a08ff Add src/qt/android/.gitignore (Hennadii Stepanov) Pull request description: This PR makes `git` ignore files created by `make apk`. ACKs for top commit: icota: ACK https://github.com/bitcoin/bitcoin/pull/22078/commits/7d07192ddeaad28a26e3c4a54757a4f27f2a08ff Tree-SHA512: 4be20bd84830217a10d8ea7634799e71ed50be73f4f60c91c56311a2c95b22ff1f28d3b7bc077f1417318bb75e446e3fc3bdbf9dbc037b4cbc8428f0875f2c77
2021-05-27Merge bitcoin/bitcoin#20833: rpc/validation: enable packages through ↵W. J. van der Laan
testmempoolaccept 13650fe2e527bf0cf5d977bf5f3f1563b853ecdc [policy] detect unsorted packages (glozow) 9ef643e21b44f99f4bce54077788d0ad4d81f7cd [doc] add release note for package testmempoolaccept (glozow) c4259f4b7ee23ef6e0ec82c5d5b9dfa9cadd5bed [test] functional test for packages in RPCs (glozow) 9ede34a6f20378e86c5289ebd20dd394a5915123 [rpc] allow multiple txns in testmempoolaccept (glozow) ae8e6df709ff3d52b8e9918e09cacb64f83ae379 [policy] limit package sizes (glozow) c9e1a26d1f17c8b98632b7796ffa8f8788b5a83c [fuzz] add ProcessNewPackage call in tx_pool fuzzer (glozow) 363e3d916cc036488783bb4bdcfdd3665aecf711 [test] unit tests for ProcessNewPackage (glozow) cd9a11ac96c01e200d0086b2f011f4a614f5a705 [test] make submit optional in CreateValidMempoolTransaction (glozow) 2ef187941db439c5b3e529f08b6ab153ff061fc5 [validation] package validation for test accepts (glozow) 578148ded62828a9820398165c41670f4dbb523d [validation] explicit Success/Failure ctors for MempoolAcceptResult (glozow) b88d77aec5e7bef5305a668d15031351c0548b4d [policy] Define packages (glozow) 249f43f3cc52b0ffdf2c47aad95ba9d195f6a45e [refactor] add option to disable RBF (glozow) 897e348f5987eadd8559981a973c045c471b3ad8 [coins/mempool] extend CCoinsViewMemPool to track temporary coins (glozow) 42cf8b25df07c45562b7210e0e15c3fd5edb2c11 [validation] make CheckSequenceLocks context-free (glozow) Pull request description: This PR enables validation dry-runs of packages through the `testmempoolaccept` RPC. The expectation is that the results returned from `testmempoolaccept` are what you'd get from test-then-submitting each transaction individually, in that order (this means the package is expected to be sorted in topological order, for now at least). The validation is also atomic: in the case of failure, it immediately halts and may return "unfinished" `MempoolAcceptResult`s for transactions that weren't fully validated. The API for 1 transaction stays the same. **Motivation:** - This allows you to test validity for transaction chains (e.g. with multiple spending paths and where you don't want to broadcast yet); closes #18480. - It's also a first step towards package validation in a minimally invasive way. - The RPC commit happens to close #21074 by clarifying the "allowed" key. There are a few added restrictions on the packages, mostly to simplify the logic for areas that aren't critical to main package use cases: - No package can have conflicts, i.e. none of them can spend the same inputs, even if it would be a valid BIP125 replacement. - The package cannot conflict with the mempool, i.e. RBF is disabled. - The total count of the package cannot exceed 25 (the default descendant count limit), and total size cannot exceed 101KvB (the default descendant size limit). If you're looking for review comments and github isn't loading them, I have a gist compiling some topics of discussion [here](https://gist.github.com/glozow/c3acaf161c95bba491fce31585b2aaf7) ACKs for top commit: laanwj: Code review re-ACK 13650fe2e527bf0cf5d977bf5f3f1563b853ecdc jnewbery: Code review ACK 13650fe2e527bf0cf5d977bf5f3f1563b853ecdc ariard: ACK 13650fe Tree-SHA512: 8c5cbfa91a6c714e1c8710bb281d5ff1c5af36741872a7c5df6b24874d6272b4a09f816cb8a4c7de33ef8e1c2a2c252c0df5105b7802f70bc6ff821ed7cc1a2f
2021-05-27Merge bitcoin/bitcoin#22025: refactor: Group and re-order CAddrMan members ↵W. J. van der Laan
by access type 8caf60dbbe16afa3c52574a7f6710d74c0bfd4ab move-only: Group and re-order CAddrMan members by access type (Hennadii Stepanov) 5cd7f8abe3996d303774b6cddeb419337d605d02 refactor: Do not expose CAddrMan members as protected without need (Hennadii Stepanov) Pull request description: This PR is split from #19238 as all of its commits are trivial to review. The last commit is easy to review with `git diff --color-moved=dimmed-zebra`. Addressed the following comments from #19238: - https://github.com/bitcoin/bitcoin/pull/19238/commits/130b82ff3588d7207c928bda16b96e720e0b24cd#r550865131 > Can you consolidate all the private members and protected members to be next to each other? Multiple private and protected access specifiers make this harder to read than is necessary. - https://github.com/bitcoin/bitcoin/pull/19238/commits/130b82ff3588d7207c928bda16b96e720e0b24cd#r557271783 > Yeah, class declaration is easier to read if there is just one instance of `public:`, `protected:` and `private:` (in that order). ACKs for top commit: jnewbery: ACK 8caf60dbbe16afa3c52574a7f6710d74c0bfd4ab laanwj: Code review ACK 8caf60dbbe16afa3c52574a7f6710d74c0bfd4ab jarolrod: ACK 8caf60dbbe16afa3c52574a7f6710d74c0bfd4ab vasild: ACK 8caf60dbbe16afa3c52574a7f6710d74c0bfd4ab Tree-SHA512: e6127fc658da7876e36f22e2fae162dc19502ed7f8e931fdebc827dabd627e5346c6fbe6f6d0cd27fd3e5c96690ff35022ff6b48f2747b748ebd66a45c851c2b
2021-05-27Merge bitcoin/bitcoin#22029: [fuzz] Improve transport deserialization fuzz ↵W. J. van der Laan
test coverage e33714557747dd479f123425aa2dd08d272ef377 [fuzz] Occasional valid magic bytes for transport serialization test (Dhruv Mehta) 35571d8d9ec112bd7b6741d10052dded08410c77 [fuzz] Occasional valid checksum for transport serialization fuzz test (Dhruv Mehta) 654472a461bc9d1603c46dcb7a5b2dc87a44045a [fuzz] Add serialization to deserialization test (Dhruv Mehta) Pull request description: This PR has 3 commits that increase the fuzz test coverage: Before commit 1: ``` #306853 REDUCE cov: 798 ft: 5820 corp: 150/375Kb lim: 68333 exec/s: 1382 rss: 461Mb L: 254/63171 MS: 1 EraseBytes- #1453105 REDUCE cov: 798 ft: 5820 corp: 150/369Kb lim: 79613 exec/s: 1467 rss: 461Mb L: 6027/60873 MS: 1 EraseBytes- ``` After commit 1 (adds serialization to de-serialization test): ``` #303389 NEW cov: 1202 ft: 8382 corp: 157/382Kb lim: 68189 exec/s: 1451 rss: 447Mb L: 1386/65459 MS: 1 CopyPart- #1428759 REDUCE cov: 1202 ft: 8512 corp: 169/389Kb lim: 78749 exec/s: 1528 rss: 463Mb L: 1627/60488 MS: 1 EraseBytes- ``` After commit 2 (provides an occasional checksum assist to the fuzzer inputs): ``` #304820 NEW cov: 1440 ft: 4452 corp: 92/12551b lim: 2237 exec/s: 3386 rss: 486Mb L: 47/1111 MS: 1 ChangeByte- #1416181 REDUCE cov: 1442 ft: 5681 corp: 125/59Kb lim: 4096 exec/s: 3522 rss: 535Mb L: 2164/4049 MS: 1 EraseBytes- ``` After commit 3 (provides an occasional magic bytes assist to the fuzzer inputs): ``` #302684 NEW cov: 1454 ft: 3936 corp: 84/7056b lim: 2424 exec/s: 4146 rss: 477Mb L: 65/1108 MS: 3 CopyPart-CrossOver-CMP- DE: "\x0e\x00\x00\x00"- #1383925 REDUCE cov: 1454 ft: 4828 corp: 102/14573b lim: 4096 exec/s: 3954 rss: 534Mb L: 116/4050 MS: 2 EraseBytes-ChangeByte- ``` If reviewers only accept the first commit, the seeds are not invalidated and new seeds are at: https://github.com/bitcoin-core/qa-assets/pull/61. In this case, we can also revert the test name change. If reviewers accept all three commits, the existing seeds are invalidated. ACKs for top commit: practicalswift: Tested ACK e33714557747dd479f123425aa2dd08d272ef377 Tree-SHA512: d37f06eea0249322b00a99c4827359eb53aeb711751e5571f4681eeca06dc257e0c4cd4887150fc37cc2f689e26986112d768066ad274361615ba9b6a522c61a
2021-05-27Merge bitcoin-core/gui#346: English translations updateHennadii Stepanov
df4c81fda490e556775f6006f3d4f7d54f61073b English translations update (Hennadii Stepanov) bfb53ddda9a31bbeb8697e65ff9987e61dac136f scripted-diff: Fix ellipsis after pr20773 (Hennadii Stepanov) Pull request description: Update for Transifex. After changing translator comments in #332 this update will show if Transifex triggers strings to be re-translated. ACKs for top commit: laanwj: ACK df4c81fda490e556775f6006f3d4f7d54f61073b jarolrod: ACK df4c81fda490e556775f6006f3d4f7d54f61073b Tree-SHA512: 1e54812bc04db6ae39e0b4d735b220ed8730a9941b17a0a2d09e21bcdd08e829adba86c35cf43c9be5e492ccb13e53a90149fcd7d6c0f5fdd022b978a1ff785c
2021-05-27Merge bitcoin/bitcoin#22063: build: Use Qt archive of the same version as ↵W. J. van der Laan
the compiled binaries cb7eba2a570e7830d53a21b7d534087c00b4cbd7 build: Use Qt archive of the same version as the compiled binaries (Hennadii Stepanov) Pull request description: This PR fixes broken Android APK build when the `depends/sources` directory contains Qt source archives of different versions (e.g., Qt version update [pull request](https://github.com/bitcoin/bitcoin/pull/22054) in CI with the cached `depends/sources` directory). This is an alternative to #22058. ACKs for top commit: MarcoFalke: review ACK cb7eba2a570e7830d53a21b7d534087c00b4cbd7 laanwj: Code review ACK cb7eba2a570e7830d53a21b7d534087c00b4cbd7 Tree-SHA512: cf63a9809fba5cb13719d7e7bb5afc718a2cff5233b0670d30d30a0018d91278fcfc2a1b9ae8b84e8e3a52c95157bc465603cc754bb8a9d1a3d62415f01ad70f
2021-05-27English translations updateHennadii Stepanov
2021-05-27scripted-diff: Fix ellipsis after pr20773Hennadii Stepanov
-BEGIN VERIFY SCRIPT- sed -i 's|_("Loading wallet...")|_("Loading wallet…")|' src/wallet/*.cpp -END VERIFY SCRIPT-
2021-05-27Merge bitcoin-core/gui#332: Replace disambiguation strings with translator ↵Hennadii Stepanov
comments 8b7713365134022475e7e5d24d3ca73149bd10e1 qt: Replace disambiguation strings with translator comments (Hennadii Stepanov) Pull request description: Since https://github.com/bitcoin/bitcoin/pull/21694 is merged, translator comments is the right way to pass context to translators. This PR fixes changes were made: - in #220 before https://github.com/bitcoin/bitcoin/pull/21694 - in https://github.com/bitcoin/bitcoin/pull/21694 on testing purpose - in #125 Closes #288. ACKs for top commit: jarolrod: ACK 8b7713365134022475e7e5d24d3ca73149bd10e1 Tree-SHA512: 466ade35f4969a41fbf3196780b1ae9fa810bab5d2f09077f8631604636cc63b24a901c719f6b5797366d2aa307993d0aa419ce35200c8d0a741a3d81cad3e6b
2021-05-27Merge bitcoin/bitcoin#22060: contrib: add torv3 seed nodes for testnet, drop ↵W. J. van der Laan
v2 ones 6fe05168587ee818e6ae4483a5984a5893131e44 contrib: add torv3 seed nodes for testnet, drop v2 ones (Jon Atack) Pull request description: Replace the ancient (2015) Tor V2 hardcoded seeds with new Tor V3 ones. This needs to be done before 0.22 to make sure onion-only testnet nodes can still connect to the network. Continues #21560. 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. - Create a new testnet node with `bitcoind -testnet -onlynet=onion -proxy=127.0.0.1:9050` (or delete `~/.bitcoin/testnet3/peers.dat`), check if it is able to connect to the network and get blocks. - Check if the addresses are connectable for ex.: ```python3 #!/usr/bin/env python3 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): subprocess.call(["nc", "-v", "-x", "127.0.0.1:9050", "-z"] + line.split(':')) ``` Thanks to jonatack for providing the list. ACKs for top commit: jonatack: ACK 6fe05168587ee818e6ae4483a5984a5893131e44 Tree-SHA512: 61bfdb44dfab9d02b75e5cb06c089a3b1a1fe7134875e1d09166c4116e961d809aa25422fe03f068876e9423b571ecc4a0c7a7eeacba4aac3b2768717f3ee6d6
2021-05-27Merge bitcoin-core/gui#311: Peers Window rename 'Peer id' to 'Peer'Hennadii Stepanov
657b33ef2de77acd1061cdf4d1d64d0e086d75df qt: add translator comments for peers table columns (Jarol Rodriguez) 73a91c63ec72e62ef76fbc857baff14b099a1358 gui: rename "Peer Id" to "Peer" in tab column and details area (Jon Atack) Pull request description: Picking up https://github.com/bitcoin-core/gui/pull/290 **Original PR Description:** - renames the peers tab column header from `Peer Id` to `Peer` to allow resizing the column more tightly (this will be particularly useful after #256) and does the same for the peer details area. While here, we also add Qt translator comments for the Peer Table columns. | Master | PR | | ----------- | ----------- | | ![Screen Shot 2021-05-03 at 1 23 05 AM](https://user-images.githubusercontent.com/23396902/116843818-20a14b00-abaf-11eb-913e-ddff11cda5cd.png) | ![Screen Shot 2021-05-05 at 4 08 45 AM](https://user-images.githubusercontent.com/23396902/117112825-a2cc7380-ad57-11eb-939b-1aceb4214ad1.png) | ACKs for top commit: jonatack: utACK 657b33ef2de77acd1061cdf4d1d64d0e086d75df hebasto: re-ACK 657b33ef2de77acd1061cdf4d1d64d0e086d75df Tree-SHA512: f50116f7ca8719cadf1f95f45e3594b3b92bde9c43eb954f3e963ed10629dd9406efdb5e96aa1f750a926e24a96321d824ed3780bd9cd748774e0b85fd0c9535
2021-05-26Add src/qt/android/.gitignoreHennadii Stepanov
This change makes git ignore files created by `make apk`.
2021-05-26Merge bitcoin-core/gui#313: qt: Optimize string concatenation by defaultW. J. van der Laan
a02c970eb001b456d74ddc30750fe8b55348ddac qt, refactor: Revert explicit including QStringBuilder (Hennadii Stepanov) 3fd3a0fc87a81d42755246830124833e9ca3f0a9 qt, build: Optimize string concatenation (Hennadii Stepanov) Pull request description: From [Qt docs](https://doc.qt.io/qt-5/qstring.html#more-efficient-string-construction): > ... multiple uses of the \[`QString`\] '+' operator usually means multiple memory allocations. When concatenating n substrings, where n > 2, there can be as many as n - 1 calls to the memory allocator. With this PR > ... the '+' will automatically be performed as the `QStringBuilder` '%' everywhere. The change in the `src/Makefile.qt.include` file does not justify submitting this PR into the main repo, IMHO. ACKs for top commit: laanwj: Code review ACK a02c970eb001b456d74ddc30750fe8b55348ddac Talkless: utACK a02c970eb001b456d74ddc30750fe8b55348ddac, built successfully on Debian Sid with Qt 5.15.2, but did not check if any displayed strings are "wrong" after refactoring. jarolrod: ACK a02c970eb001b456d74ddc30750fe8b55348ddac Tree-SHA512: cbb476ee96f27c3bd6e125efab74d8bf24bbdb4c30576b3feea45e203405f3bf5b497dd7d3e11361fc825fcbf4b893b152921a9efdeaf73b42d1865d85f0ae84
2021-05-26MOVEONLY: CWallet transaction code out of wallet.cpp/.hRussell Yanofsky
This commit just moves functions without making any changes. It can be reviewed with `git log -p -n1 --color-moved=dimmed_zebra` Motivation for this change is to make wallet.cpp/h less monolithic and start to make wallet transaction state tracking comprehensible so bugs in https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking can be fixed safely without introducing new problems. This commit moves wallet classes and methods that deal with transactions out of wallet.cpp/.h into better organized files: - transaction.cpp/.h - CWalletTx and CMerkleTx class definitions - receive.cpp/.h - functions checking received transactions and computing balances - spend.cpp/.h - functions creating transactions and finding spendable coins After #20773, when loading is separated from syncing it will also be possible to move more wallet.cpp/.h functions to: - sync.cpp/.h - functions handling chain notifications and rescanning This commit arranges receive.cpp and spend.cpp functions in dependency order so it's possible to skim receive.cpp and get an idea of how computing balances works, and skim spend.cpp and get an idea of how transactions are created, without having to jump all over wallet.cpp where functions are not in order and there is a lot of unrelated code. Followup commit "refactor: Detach wallet transaction methods" in https://github.com/bitcoin/bitcoin/pull/21206 follows up this PR and tweaks function names and arguments to reflect new locations. The two commits are split into separate PRs because this commit is more work to maintain and less work to review, while the other commit is less work to maintain and more work to review, so hopefully this commit can be merged earlier.
2021-05-26Merge bitcoin/bitcoin#18418: wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100fanquake
e6fe1c37d0a2f8037996dd80619d6c23ec028729 rpc: Improve avoidpartialspends and avoid_reuse documentation (Fabian Jahr) 8f073076b102b77897e5a025ae555baae3d1f671 wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100 (Fabian Jahr) Pull request description: Follow-up to #17824. This increases OUTPUT_GROUP_MAX_ENTRIES to 100 which means that OutputGroups will now be up to 100 outputs large, up from previously 10. The main motivation for this change is that during the PR review club on #17824 [several participants signaled](https://bitcoincore.reviews/17824.html#l-339) that 100 might be a better value here. I think fees should be manageable for users but more importantly, users should know what they can expect when using the wallet with this configuration, so I also tried to clarify the documentation on `-avoidpartialspends` and `avoid_reuse` a bit. If there are other additional ways how or docs where users can be made aware of the potential consequences of using these parameters, please let me know. Another small upside is that [there seem to be a high number of batching transactions with 100 and 200 inputs](https://miro.medium.com/max/3628/1*sZ5eaBSbsJsHx-J9iztq2g.png)([source](https://medium.com/@hasufly/an-analysis-of-batching-in-bitcoin-9bdf81a394e0)) giving these transactions a bit of a larger anonymity set, although that is probably a very weak argument. ACKs for top commit: jnewbery: ACK e6fe1c37d0 Xekyo: retACK e6fe1c37d0a2f8037996dd80619d6c23ec028729 rajarshimaitra: tACK `e6fe1c3` achow101: ACK e6fe1c37d0a2f8037996dd80619d6c23ec028729 glozow: code review ACK https://github.com/bitcoin/bitcoin/pull/18418/commits/e6fe1c37d0a2f8037996dd80619d6c23ec028729 Tree-SHA512: 79685c58bafa64ed8303b0ecd616fce50fc9a2b758aa79833e4ad9f15760e09ab60c007bc16ab4cbc4222e644cfd154f1fa494b0f3a5d86faede7af33a6f2826
2021-05-26Merge bitcoin-core/gui#121: Early subscribe core signals in transaction ↵Hennadii Stepanov
table model cafef080a2e59c2bcae6baeee3c3c7e187e931ae qt: Refactor to remove unnecessary block in DispatchNotifications (João Barbosa) 57785fb7f61e51e8a8a459486a594443665ea8c9 qt: Early subscribe core signals in transaction table model (João Barbosa) c6cbdf1a90a253fef0259b365a782bf88cd437f2 qt: Refactor ShowProgress to DispatchNotifications (João Barbosa) 3bccd50ad2f384e6c8c97c7f44bda7ae0d777696 qt: Set flag after inital load on transaction table model (João Barbosa) Pull request description: This fixes the case where transaction notifications arrive between `getWalletTxs` and `subscribeToCoreSignals`. Basically notifications are queued until `getWalletTxs` and wallet rescan complete. This is also a requirement to call `getWalletTxs` in a background thread. Motivated by https://github.com/bitcoin/bitcoin/issues/20241. ACKs for top commit: jonatack: tACK cafef080a2e59c2bcae6baeee3c3c7e187e931ae ryanofsky: Code review ACK cafef080a2e59c2bcae6baeee3c3c7e187e931ae. Only change since last review is splitting commits and replacing m_progress with m_loading. meshcollider: Code review ACK cafef080a2e59c2bcae6baeee3c3c7e187e931ae Tree-SHA512: 003caab2f2ae3522619711c8d02d521d2b8f7f280a467f6c3d08abf37ca81cc66b4b9fa10acfdf34e5fe250da7b696cfeec435f72b53c1ea97ccda96d8b4be33
2021-05-26Merge bitcoin/bitcoin#21966: Remove double serialization; use software ↵W. J. van der Laan
encoder for fee estimation 66545da2008cd9e806e41b74522ded259cd64f86 Remove support for double serialization (Pieter Wuille) fff1cae43af959a601cf2558cb3c77f3c2b1aa80 Convert uses of double-serialization to {En,De}codeDouble (Pieter Wuille) afd964d70b6f7583ecf89c380f80db07f5b66a60 Convert existing float encoding tests (Pieter Wuille) bda33f98e2f32f2411fb0a8f5fb4f0a32abdf7d4 Add unit tests for serfloat module (Pieter Wuille) 2be4cd94f4c7d92a4287971233a20d68db81c9c9 Add platform-independent float encoder/decoder (Pieter Wuille) e40224d0c77674348bf0a518365208bc118f39a4 Remove unused float serialization (MarcoFalke) Pull request description: Based on #21981. This adds a software-based platform-independent float/double encoder/decoder (platform independent in the sense that it only uses arithmetic and library calls, but never inspects the binary representation). This should strengthen our guarantee that encoded float/double values are portable across platforms. It then removes the functionality to serialize doubles from serialize.h, and replaces its only (non-test) use for fee estimation data serialization with the software encoder. At least on x86/ARM, the only difference should be how certain NaN values are encoded/decoded (but not *whether* they are NaN or not). It comes with tests that verify on is_iec559 platforms (which are the only ones we support, at least for now) that the serialized bytes exactly match the binary representation of floats in memory (for non-NaN). ACKs for top commit: laanwj: Code review re-ACK 66545da2008cd9e806e41b74522ded259cd64f86 practicalswift: cr re-ACK 66545da2008cd9e806e41b74522ded259cd64f86 Tree-SHA512: 62ad9adc26e28707b2eb12a919feefd4fd10cf9032652dbb1ca1cc97638ac21de89e240858e80d293d5112685c623e58affa3d316a9783ff0e6d291977a141f5
2021-05-26Merge bitcoin/bitcoin#22042: Replace size/weight estimate tuple with struct ↵fanquake
for named fields 881a3e2e17c5a6fdffb16a47a2eaff9029f261e5 Replace size/weight estimate tuple with struct for named fields (Gregory Sanders) Pull request description: For clarity of return values of size estimation functions. ACKs for top commit: MarcoFalke: review ACK 881a3e2e17c5a6fdffb16a47a2eaff9029f261e5 practicalswift: cr ACK 881a3e2e17c5a6fdffb16a47a2eaff9029f261e5 Tree-SHA512: 9aa97e3774fcaf1e5b905259418d827051325c2ad76d6c7388ad7c687c605c024a6c5d2f7e9565f4c180ad1a9f6b179557fcb8b23371ff1a4f3b81300ac1f3d1
2021-05-26fuzz: don't try and use fopencookie when building for Androidfanquake
When building for Android, _GNU_SOURCE will be defined, but it doesn't actually have the fopencookie() function, or define the cookie_io_functions_t type. For now just skip trying to use it if we are building for Android. Should fix #22062.
2021-05-25qt: add translator comments for peers table columnsJarol Rodriguez
Adds Qt Translator Comments to each Peers Table column to aid translators by providing context.
2021-05-26Replace size/weight estimate tuple with struct for named fieldsGregory Sanders
2021-05-26Merge bitcoin-core/gui#297: Avoid unnecessary translationsv21.99-guixtest1Hennadii Stepanov
19d51a2907cc00244510460a658c482d1b4bdfda qt: Avoid unnecessary translations (Hennadii Stepanov) Pull request description: Working on translation, I found these translations introduced in #79, that are unnecessary (assuming the universal nature of the "BTC" string). ACKs for top commit: jarolrod: ACK 19d51a2907cc00244510460a658c482d1b4bdfda Tree-SHA512: b45551a54a323c5ba3779f4c1d7c8e7ec4d19a2e95fe70153f48234393bf1449a08e6bd24519ec035ebd4a98080a56af45e7a21546b47152e493b8e1b8f4345e
2021-05-25build: Use Qt archive of the same version as the compiled binariesHennadii Stepanov
This change fixes broken Android APK build when the `depends/sources` directory contains Qt source archives of different versions (e.g., Qt version update pull request in CI with the cached `depends/sources` directory).
2021-05-25[fuzz] Occasional valid magic bytes for transport serialization testDhruv Mehta
Before commit: Unable to deserialize : 0% Wrong message start : ~45.62% Header too large : ~14.5% Wrong checksum : ~38.13% Invalid message type : ~1.78% 304820 NEW cov: 1440 ft: 4452 corp: 92/12551b lim: 2237 exec/s: 3386 rss: 486Mb L: 47/1111 MS: 1 ChangeByte- 1416181 REDUCE cov: 1442 ft: 5681 corp: 125/59Kb lim: 4096 exec/s: 3522 rss: 535Mb L: 2164/4049 MS: 1 EraseBytes- After commit: Unable to deserialize : 0% Wrong message start : ~39.6% Header too large : ~30.85% Wrong checksum : ~25.54% Invalid message type : ~4.01% 302684 NEW cov: 1454 ft: 3936 corp: 84/7056b lim: 2424 exec/s: 4146 rss: 477Mb L: 65/1108 MS: 3 CopyPart-CrossOver-CMP- DE: "\x0e\x00\x00\x00"- 1383925 REDUCE cov: 1454 ft: 4828 corp: 102/14573b lim: 4096 exec/s: 3954 rss: 534Mb L: 116/4050 MS: 2 EraseBytes-ChangeByte-
2021-05-25[fuzz] Occasional valid checksum for transport serialization fuzz testDhruv Mehta
Before commit: Unable to deserialize: 0% Wrong message start : ~1.27% Header too large : ~0.5% Wrong checksum : ~67.99% Invalid message type : ~30.1% 303389 NEW cov: 1202 ft: 8382 corp: 157/382Kb lim: 68189 exec/s: 1451 rss: 447Mb L: 1386/65459 MS: 1 CopyPart- 1428759 REDUCE cov: 1202 ft: 8512 corp: 169/389Kb lim: 78749 exec/s: 1528 rss: 463Mb L: 1627/60488 MS: 1 EraseBytes- After commit(new seeds; old seeds invalidated): Unable to deserialize: 0% Wrong message start : ~45.62% Header too large : ~14.5% Wrong checksum : ~38.13% Invalid message type : ~1.78% 304820 NEW cov: 1440 ft: 4452 corp: 92/12551b lim: 2237 exec/s: 3386 rss: 486Mb L: 47/1111 MS: 1 ChangeByte- 1416181 REDUCE cov: 1442 ft: 5681 corp: 125/59Kb lim: 4096 exec/s: 3522 rss: 535Mb L: 2164/4049 MS: 1 EraseBytes-
2021-05-25[fuzz] Add serialization to deserialization testDhruv Mehta
Before commit: 306853 REDUCE cov: 798 ft: 5820 corp: 150/375Kb lim: 68333 exec/s: 1382 rss: 461Mb L: 254/63171 MS: 1 EraseBytes- 1453105 REDUCE cov: 798 ft: 5820 corp: 150/369Kb lim: 79613 exec/s: 1467 rss: 461Mb L: 6027/60873 MS: 1 EraseBytes- After commit: 303389 NEW cov: 1202 ft: 8382 corp: 157/382Kb lim: 68189 exec/s: 1451 rss: 447Mb L: 1386/65459 MS: 1 CopyPart- 1428759 REDUCE cov: 1202 ft: 8512 corp: 169/389Kb lim: 78749 exec/s: 1528 rss: 463Mb L: 1627/60488 MS: 1 EraseBytes-
2021-05-25contrib: add torv3 seed nodes for testnet, drop v2 onesJon Atack
2021-05-26Merge bitcoin/bitcoin#17331: Use effective values throughout coin selectionSamuel Dobson
51a3ac242c92e69b59df26f8f9e287b31e5c3b0f Have OutputGroup determine the value to use (Andrew Chow) 6d6d2784759878ef0c4ac128d12aac68add1edca Change SelectCoins_test to actually test SelectCoins (Andrew Chow) 9d3bd74ab4430532d6e53eef8cf77ad999044b14 Remove CreateTransaction while loop and some related variables (Andrew Chow) 6f0d5189af4c881fe8b97a0c28ce1ffa33480715 Remove use_bnb and bnb_used (Andrew Chow) de26eb0e1fa2b6f03c58ba104d00f7a8ffead39c Do both BnB and Knapsack coin selection in SelectCoinsMinConf (Andrew Chow) 01dc8ebda50a382d45d3d169b2c3f3965869dcae Have KnapsackSolver actually use effective values (Andrew Chow) bf26e018de33216d6f0ed0d6ff822b93536f7cc1 Roll static tx fees into nValueToSelect instead of having it be separate (Andrew Chow) cc3f14b27c06b7a0da1472f5c7100c3f0b76fd98 Move output reductions for fee to after coin selection (Andrew Chow) d97d25d95006725e705635530b27643363d6b2a4 Make cost_of_change part of CoinSelectionParams (Andrew Chow) af5867c89688b06173b295b7c32a42845ea455da Move some calculations to common code in SelectCoinsMinConf (Andrew Chow) 1bf4a62cb61bd4b91d9cd4e379fea2b914786342 scripted-diff: rename some variables (Andrew Chow) Pull request description: Changes `KnapsackSolver` to use effective values instead of just the nominal txout value. Since fees are taken into account during the selection itself, we finally get rid of the `CreateTransaction` loop as well as a few other things that only were only necessary because of that loop. This should not change coin selection behavior at all (except maybe remove weird edge cases that were caused by the loop). In order to keep behavior the same, `KnapsackSolver` will select outputs with a negative effective value (as it did before). ACKs for top commit: ryanofsky: Code review ACK 51a3ac242c92e69b59df26f8f9e287b31e5c3b0f. Looks good to go! instagibbs: review ACK https://github.com/bitcoin/bitcoin/pull/17331/commits/51a3ac242c92e69b59df26f8f9e287b31e5c3b0f meshcollider: re-light-utACK 51a3ac242c92e69b59df26f8f9e287b31e5c3b0f Tree-SHA512: 372c27e00edcd5dbf85177421ba88f20bfdaf1791b6e3dc022c44876ecc379403e2375ed69e71c512c49e6af87641001ff385c4b25ab93684b3a08a53bf3824e
2021-05-25Merge bitcoin/bitcoin#22043: rpc, test: addpeeraddress test coverage, code ↵MarcoFalke
simplify/constness b36e0cd1b9d361ac6f9777c09328a13e9ee923be rpc: simplify addpeeraddress and improve code constness (Jon Atack) 6b1926cf1eac1ad1850599d2753dd22bc21fd327 test: addpeeraddress functional test coverage (Jon Atack) Pull request description: - Add functional test coverage for rpc addpeeraddress - Simplify addpeeraddress and improve code constness ACKs for top commit: klementtan: ACK [`b36e0cd`](https://github.com/bitcoin/bitcoin/pull/22043/commits/b36e0cd1b9d361ac6f9777c09328a13e9ee923be) MarcoFalke: review ACK b36e0cd1b9d361ac6f9777c09328a13e9ee923be 💭 Tree-SHA512: 01773fb70f23db5abf46806bb27804e48feff27272b2e6582bd5b886e9715088eb2d84755106bce2ad6f88e21582f7f071a30a89d5b17286d899c3dd8553b4fc
2021-05-25Merge bitcoin/bitcoin#22021: rpc: bumpfee/psbtbumpfee fixes and updatesMarcoFalke
4f504f826bcbb1a4aa4701e87cb68da4ca05b857 rpc: fix code comment for bumpfee/psbtbumpfee output (Jon Atack) 5cb7ac23fb97a0cbc75b7eef0951da0e0bc5292b rpc: fix docs for bumpfee psbt update (Jon Atack) Pull request description: Follow-up to #21544 and #20891 for the `bumpfee_helper` used for RPCs bumpfee and psbtbumpfee: - "psbt" field is only returned in psbtbumpfee and not bumpfee - bumpfee raises if private keys are disabled, so the txid help "Only returned when wallet private keys are enabled." no longer makes sense; remove it - add missing space in RPC examples ("Bump the fee, get the new transaction'stxid") - update txid/psbt code comments ACKs for top commit: klementtan: ACK [`4f504f8`](https://github.com/bitcoin/bitcoin/pull/22021/commits/4f504f826bcbb1a4aa4701e87cb68da4ca05b857) Tree-SHA512: 194faf8af52383eb8ac5cd22825265931bcde135dac79d8ecc4f84f698070da9b9373c00eef8623961881bb293157c7c9a0d71d1bcccf481ae3605a2d1444ed8
2021-05-25Merge bitcoin/bitcoin#21992: p2p: Remove -feefilter optionMarcoFalke
a7a43e8fe85f6247c35d7ff99f36448574f3e34a Factor feefilter logic out (amadeuszpawlik) c0385f10a133d5d8a4c296e7b7a6d75c9c4eec12 Remove -feefilter option (amadeuszpawlik) Pull request description: net: Remove -feefilter option, as it is debug only and isn't used in any tests. Checking this option for every peer on every iteration of the message handler is unnecessary, as described in #21545. refactor: Move feefilter logic out into a separate `MaybeSendFeefilter(...)` function to improve readability of the already long `SendMessages(...)`. fixes #21545 The configuration option `-feefilter` has been added in 9e072a6e66efbda7d39bf61eded21d2b324323be: _"Implement "feefilter" P2P message"_ According to the [BIP133](https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki), turning the fee filter off was ment for: > [...] a node [...] using prioritisetransaction to accept transactions whose actual fee rates might fall below the node's mempool min fee [in order to] disable the fee filter to make sure it is exposed to all possible txid's `-feefilter` was subsequently set as debug only in #8150, with the motivation that the help message was too difficult to translate. ACKs for top commit: jnewbery: Code review ACK a7a43e8fe85f6247c35d7ff99f36448574f3e34a promag: Code review ACK a7a43e8fe85f6247c35d7ff99f36448574f3e34a. MarcoFalke: review ACK a7a43e8fe85f6247c35d7ff99f36448574f3e34a 🦁 Tree-SHA512: 8ef9a2f255597c0279d3047dcc968fd30fb7402e981b69206d08eed452c705ed568c24e646e98d06eac118eddd09205b584f45611d1c874abf38f48b08b67630
2021-05-24Remove support for double serializationPieter Wuille
2021-05-24Convert uses of double-serialization to {En,De}codeDoublePieter Wuille
2021-05-24Convert existing float encoding testsPieter Wuille
2021-05-24Add unit tests for serfloat modulePieter Wuille
2021-05-24Add platform-independent float encoder/decoderPieter Wuille
2021-05-24Remove unused float serializationMarcoFalke
2021-05-24move-only: Group and re-order CAddrMan members by access typeHennadii Stepanov
Easy to verify with `git diff --color-moved=dimmed-zebra`.
2021-05-24[policy] detect unsorted packagesglozow
2021-05-24[rpc] allow multiple txns in testmempoolacceptglozow
Only allow "packages" with no conflicts, sorted in order of dependency, and no more than 25 for now. Note that these groups of transactions don't necessarily need to adhere to some strict definition of a package or have any dependency relationships. Clients are free to pass in a batch of 25 unrelated transactions if they want to.
2021-05-24[policy] limit package sizesglozow
Maximum number of transactions allowed in a package is 25, equal to the default mempool descendant limit: if a package has more transactions than this, either it would fail default mempool descendant limit or the transactions don't all have a dependency relationship (but then they shouldn't be in a package together). Same rationale for 101KvB virtual size package limit. Note that these policies are only used in test accepts so far.
2021-05-24[fuzz] add ProcessNewPackage call in tx_pool fuzzerglozow
2021-05-24[test] unit tests for ProcessNewPackageglozow
Key functionality = a transaction with UTXOs not present in UTXO set or mempool can be fully validated instead of being considered an orphan.
2021-05-24[test] make submit optional in CreateValidMempoolTransactionglozow
This allows us to easily create transaction chains for package validation. We don't test_accept if submit=false because we want to be able to make transactions that wouldn't pass ATMP (i.e. a child transaction in a package would fail due to missing inputs).
2021-05-24[validation] package validation for test acceptsglozow
Only allow test accepts for now. Use the CoinsViewTemporary to keep track of coins created by each transaction so that subsequent transactions can spend them. Uncache all coins since we only ever do test accepts (Note this is different from ATMP which doesn't uncache for valid test_accepts) to minimize impact on the coins cache. Require that the input txns have no conflicts and be ordered topologically. This commit isn't able to detect unsorted packages.
2021-05-24Factor feefilter logic outamadeuszpawlik
Break SendMessages() function into smaller units to improve readability. Adds lock assert, as `round()` isn't thread safe. closes #21545
2021-05-24Merge bitcoin/bitcoin#22013: net: ignore block-relay-only peers when ↵fanquake
skipping DNS seed fe3d17df04decc4e856121eb311636977d60f80f net: ignore block-relay-only peers when skipping DNS seed (Anthony Towns) Pull request description: Since #17428 bitcoind will attempt to reconnect to two block-relay-only anchors before doing any other outbound connections. When determining whether to use DNS seeds, it will currently see these two peers and decide "we're connected to the p2p network, so no need to lookup DNS" -- but block-relay-only peers don't do address relay, so if your address book is full of invalid addresses (apart from your anchors) this behaviour will prevent you from recovering from that situation. This patch changes it so that it only skips use of DNS seeds when there are two full-outbound peers, not just block-relay-only peers. ACKs for top commit: Sjors: utACK fe3d17d amitiuttarwar: ACK fe3d17df04decc4e856121eb311636977d60f80f, this impacts the very common case where we stop/start a node, persisting anchors & have a non-empty addrman (although, to be clear, wouldn't be particularly problematic in the common cases where the addrman has valid addresses) mzumsande: ACK fe3d17df04decc4e856121eb311636977d60f80f jonatack: ACK fe3d17df04decc4e856121eb311636977d60f80f prayank23: tACK https://github.com/bitcoin/bitcoin/pull/22013/commits/fe3d17df04decc4e856121eb311636977d60f80f Tree-SHA512: 9814b0d84321d7f45b5013eb40c420a0dd93bf9430f5ef12dce50d1912a18d5de2070d890a8c6fe737a3329b31059b823bc660b432d5ba21f02881dc1d951e94