aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-03-02wallet: use constant CWallets in rpcdump.cppKarl-Johan Alm
* GetWalletAddressesForKey is, as the name implies, immutable; the one change besides the parameter constness is a [] -> .at() change, to a verified-existing key. * dumpprivkey and dumpwallet are both similarly immutable, for obvious reasons.
2020-03-02wallet/db: make IsDummy() constKarl-Johan Alm
This method does a simple check and no modifications.
2020-03-02wallet/db: make Backup() constKarl-Johan Alm
This method is the to-disk equivalent of serialize methods which are also const.
2020-03-02wallet: make CanGetAddresses() constKarl-Johan Alm
CWallet::CanGetAddresses() is used to check whether the wallet has available or is able to produce keys for addresses. It uses the ScriptPubKeyMan::CanGetAddresses(), which in turn uses the const KeypoolCountExternalKeys() method, all which do counting and no modifications.
2020-03-02wallet: make KeypoolCountExternalKeys() constKarl-Johan Alm
This method returns the sum of the key pool sizes. It does no modification.
2020-03-02wallet: make CanGenerateKeys() constKarl-Johan Alm
This method simply checks if HD is or can be enabled and does not require mutability.
2020-03-02make BlockUntilSyncedToCurrentChain() constKarl-Johan Alm
The method checks the chain tip for the best block, and calls SyncWithValidationInterfaceQueue() (a standalone function) if necessary.
2020-03-01Merge #17399: validation: Templatize ValidationState instead of subclassingMarcoFalke
10efc0487c442bccb0e4a9ac29452af1592a3cf2 Templatize ValidationState instead of subclassing (Jeffrey Czyz) 10e85d4adc9b7dbbda63e00195e0a962f51e4d2c Remove ValidationState's constructor (Jeffrey Czyz) 0aed17ef2892478c28cd660e53223c6dd1dc0187 Refactor FormatStateMessage into ValidationState (Jeffrey Czyz) Pull request description: This removes boilerplate code in the subclasses which otherwise only differ by the result type. The subclassing was introduced in a27a295. ACKs for top commit: MarcoFalke: ACK 10efc0487c442bccb0e4a9ac29452af1592a3cf2 šŸ± ajtowns: ACK 10efc0487c442bccb0e4a9ac29452af1592a3cf2 -- looks good to me jonatack: ACK 10efc048 code review, build/tests green, nice cleanup Tree-SHA512: 765dd52dde7d49b9a5c6d99d97c96f4492673e2aed0b0604faa88db0308fa4500a26bf755cca0b896be283874096c215932e1110a2d01dc012cd36a5fce58a42
2020-02-29Merge #18229: random: drop unused MACH time headersfanquake
d36146009fb3fc9b9a772823b4df139a85173481 Drop unused mach time headers (Ben Woosley) Pull request description: Now that we're no longer special-casing clock usage for MacOS (see #17800), we're not referencing anything defined in these headers. Incidentally, this removes our last reference to the `__MACH__` system def. šŸŽ‰ ACKs for top commit: jonasschnelli: utACK d36146009fb3fc9b9a772823b4df139a85173481 fanquake: ACK d36146009fb3fc9b9a772823b4df139a85173481 - thanks. Tree-SHA512: 246045b0683a705ad034416e8ace2024e652026a6c0517b6797320e52fc18a6e111ec2e405ca40653bd1d6421bb7755232e8fec22651fff8e448eb7d5646a954
2020-02-29Merge #18225: util: Fail to parse empty string in ParseMoneyfanquake
8888461f6814ae8b6221b02049fb9e1f69a5ff70 util: Fail to parse empty string in ParseMoney (MarcoFalke) fab30b61eb51538a4db62e34f7133c44575b3fe9 util: Remove unused ParseMoney that takes a c_str (MarcoFalke) Pull request description: Supplying a fee rate or an amount on the command line as an empty string, which currently parses as `0` seems fragile and confusing. See for example the confusion in #18214. Fixes #18214 ACKs for top commit: Empact: Code Review ACK https://github.com/bitcoin/bitcoin/pull/18225/commits/8888461f6814ae8b6221b02049fb9e1f69a5ff70 achow101: ACK 8888461f6814ae8b6221b02049fb9e1f69a5ff70 instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/18225/commits/8888461f6814ae8b6221b02049fb9e1f69a5ff70 Tree-SHA512: ac2d6b7fa89fe5809c34d5f49831042032591c34fb3c76908d72fed51e8bced41bf2b41dc1b3be34ee691a40463355649857a7a8f378709d38ae89503feb11c2
2020-02-28Drop unused mach time headersBen Woosley
Now that we're no longer special-casing clock usage for MacOS, we're not referencing anything defined in these headers.
2020-02-28Merge #16562: Refactor message transport packagingMarcoFalke
16d6113f4faa901e248adb693d4768a9e5019a16 Refactor message transport packaging (Jonas Schnelli) Pull request description: This PR factors out transport packaging logic from `CConnman::PushMessage()`. It's similar to #16202 (where we refactor deserialization). This allows implementing a new message transport protocol like BIP324. ACKs for top commit: dongcarl: ACK 16d6113f4faa901e248adb693d4768a9e5019a16 FWIW ariard: Code review ACK 16d6113 elichai: semiACK 16d6113f4faa901e248adb693d4768a9e5019a16 ran functional+unit tests. MarcoFalke: ACK 16d6113f4faa901e248adb693d4768a9e5019a16 šŸ™Ž Tree-SHA512: 8c2f8ab9f52e9b94327973ae15019a08109d5d9f9247492703a842827c5b5d634fc0411759e0bb316d824c586614b0220c2006410851933613bc143e58f7e6c1
2020-02-28Merge #17800: random: don't special case clock usage on macOSWladimir J. van der Laan
dc9305b6162ec615ff5fb2876e4f312051b543af random: don't special case clock usage on macOS (fanquake) Pull request description: `clock_gettime()`, `CLOCK_MONOTONIC` and `CLOCK_REALTIME` are all available for use on macOS (now that we require macOS >=10.12 and build against 10.14). Use them rather than the [deprecated](https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/Mach/Mach.html) `mach_timespec_t` time API. I mentioned the possibility for this change [in #17270](https://github.com/bitcoin/bitcoin/pull/17270#discussion_r346090606). [master](1dbf3350c683f93d7fc9b861400724f6fd2b2f1d): ```bash 2019-12-23T20:49:43Z Feeding 216 bytes of dynamic environment data into RNG 2019-12-23T20:50:43Z Feeding 216 bytes of dynamic environment data into RNG ``` This PR: ```bash 2019-12-23T20:32:41Z Feeding 232 bytes of dynamic environment data into RNG 2019-12-23T20:33:42Z Feeding 232 bytes of dynamic environment data into RNG ``` ~~Depends on #16392.~~ Merged. ACKs for top commit: laanwj: ACK dc9305b6162ec615ff5fb2876e4f312051b543af Tree-SHA512: 18c2f336ea628f9cf7339b817381d230a18893fd9c0351bf99a39ca6f45c5b0a20af9d599d48d6c09515627d5edafa91337c17f9f790264251d2cdcb3763bbd5
2020-02-29Merge #18173: refactor: test/bench: deduplicate SetupDummyInputs()MarcoFalke
7bf4ce4f644bb7dac9b63172c656b5d599eedea3 refactor: test/bench: dedup SetupDummyInputs() (Sebastian Falbesoner) Pull request description: The only difference between `SetupDummyInputs()` in `test/transaction_tests.cpp` and the one in `bench/ccoins_caching.cpp` was the nValue amounts of the outputs, so we allow to pass those in an extra (fixed-size) array parameter. ACKs for top commit: MarcoFalke: re-ACK 7bf4ce4f64, only change is schuffling includes šŸš¶ Empact: ACK https://github.com/bitcoin/bitcoin/pull/18173/commits/7bf4ce4f644bb7dac9b63172c656b5d599eedea3 Tree-SHA512: e13643b2470f6b6ab429da0c0a8eebd4cb41e2ff2e421ef36f85fa4847bf4ea8aab88d59a01e94cac4c4eb85edb561463f02215b174c50b573ac6bbcc2bf98a3
2020-02-28refactor: test/bench: dedup SetupDummyInputs()Sebastian Falbesoner
The only difference between SetupDummyInputs() in test/transaction_tests.cpp and the one in bench/ccoins_caching.cpp was the nValue amounts of the outputs, so we allow to pass those in an extra (fixed-size) array parameter.
2020-02-29Merge #18195: test: Add cost_of_change parameter assertions to bnb_search_testMarcoFalke
c72a11a1a030036eb1fe4472086a9733731961ce test: Add cost_of_change parameter assertions to bnb_search_test (Yancy Ribbens) Pull request description: If the `cost_of_change` variable is removed from the method body `SelectCoinsBnB`, there are currently no failing unit tests. This PR adds assertions about the behavior of the `cost_of_change`: If the cost of creating a change output is greater than what's leftover, then consume the output and create no change, otherwise, don't consume the output (no match found). ACKs for top commit: achow101: ACK c72a11a1a030036eb1fe4472086a9733731961ce Tree-SHA512: 613aa411df5e2911446e0e8bf3309336faaadf2d3c56e7d125b76454e7c6f9e4f5e8f0910dc6222282628e38cd8a4a7c56bb3d36b564a17f396b9b503ecc64c8
2020-02-29util: Fail to parse empty string in ParseMoneyMarcoFalke
2020-02-29util: Remove unused ParseMoney that takes a c_strMarcoFalke
2020-02-27Templatize ValidationState instead of subclassingJeffrey Czyz
This removes boilerplate code in the subclasses which otherwise only differ by the result type.
2020-02-27Remove ValidationState's constructorJeffrey Czyz
2020-02-27Refactor FormatStateMessage into ValidationStateJeffrey Czyz
2020-02-28Merge #17771: tests: Add fuzzing harness for V1TransportDeserializer (P2P ā†µMarcoFalke
transport) 2f63ffd15caeb79867e56c8cedbe2c702952db9e tests: Add fuzzing harness for V1TransportDeserializer (P2P transport) (practicalswift) Pull request description: Add fuzzing harness for `V1TransportDeserializer` (P2P transport). **Testing this PR** Run: ``` $ make distclean $ ./autogen.sh $ CC=clang CXX=clang++ ./configure --enable-fuzz \ --with-sanitizers=address,fuzzer,undefined $ make $ src/test/fuzz/p2p_transport_deserializer ā€¦ ``` ACKs for top commit: MarcoFalke: ACK 2f63ffd15caeb79867e56c8cedbe2c702952db9e Tree-SHA512: 8507d4a0414d16f1b8cc9649e3e638f74071dddc990d7e5d7e6faf77697f50bdaf133e49e2371edd29068a069a074469ef53148c6bfc9950510460b81d87646a
2020-02-27Merge #18211: test: Disable mockforward scheduler unit test for nowfanquake
fab2527515e8db944ae044bea8580e2cd9414bcd test: Disable mockforward scheduler unit test for now (MarcoFalke) Pull request description: This should be a workaround to fix #18174 in the short run and buy us more time to investigate the issue while ci runs are green again :pray: ACKs for top commit: fanquake: ACK fab2527515e8db944ae044bea8580e2cd9414bcd - be good to get Travis back. laanwj: ACK fab2527515e8db944ae044bea8580e2cd9414bcd Tree-SHA512: 027e86b3dfec203a464e5bf528e9933c208c36633c2d4bfcdbc10da1799637a5d6ea0a63af33a4174fb1ad7115df631a4cb838f56e31f4cbd15498e1e9fdf9cc
2020-02-26Merge #18167: Fix a violation of C++ standard rules where unions are used ā†µWladimir J. van der Laan
for type-punning 0653939ac130eddffe40c53ac418bea305d3bf82 Add static_asserts to ser_X_to_Y() methods (Samer Afach) be94096dfb0c4862e2314cbae4120d7360b08ef2 Fix a violation of C++ standard rules that unions cannot be switched. (Samer Afach) Pull request description: Type punning in C++ is not like C. As per the C++ standard, one cannot use unions to convert the bit type. A discussion about this can be found [here](https://stackoverflow.com/questions/25664848/unions-and-type-punning). In C++, a union is supposed to only hold one type at a time. It's intended to be used only as `std::variant`. Switching types is undefined behavior. In fact, C++20 has a special casting function, called [`bit_cast`](https://en.cppreference.com/w/cpp/numeric/bit_cast) that solved this problem. Why has it been working so far? Because some compilers tolerate using unions and switching types, like gcc. More information [here](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Type-punning). One important thing to mention is that performance is generally not affected by that memcpy. Compilers are smart enough to convert that to a memory cast when possible. But we have to do it the right way, otherwise, it's jut undefined behavior that depends on the compiler. ACKs for top commit: practicalswift: ACK 0653939ac130eddffe40c53ac418bea305d3bf82 elichai: ACK 0653939ac130eddffe40c53ac418bea305d3bf82 laanwj: Code review ACK 0653939ac130eddffe40c53ac418bea305d3bf82 kristapsk: ACK 0653939ac130eddffe40c53ac418bea305d3bf82 Tree-SHA512: f6e89de39fc964750429139bab6b5a1346f7060334b7afa020e315bdad8f8c195bce2b8a9e343f06e7fff175e2dfb1cdabfcb6fe405bea0febe4962f0cc62557
2020-02-26Merge #17985: net: Remove forcerelay of rejected txsWladimir J. van der Laan
facb71576cd4d2e90fd03e09d29b42fa3d730e8c net: Remove forcerelay of rejected txs (MarcoFalke) Pull request description: This removes the code that supposedly handled the forced relay of txs from a permissioned peer that were rejected from our mempool. The removal should be fine, because it is dead code for the following reasons: * While `RelayTransaction` enqueues the inv for all peers, the inv is never processed because it can not be found in the mempool. See https://github.com/bitcoin/bitcoin/blob/4a072330763b3ff2d1b5c5b8d30a9517873ac6de/src/net_processing.cpp#L3862-L3866 * Even if the peers we intended to send the inv to can somehow reply with a getdata to the never-received inv, they won't receive the tx as a reply because it was never added to the "relay memory" (`mapRelay`) The dead code is (obviously) untested: https://marcofalke.github.io/btc_cov/total.coverage/src/net_processing.cpp.gcov.html#2574 This feature was (intentionally or accidentally) removed in 4d8993b3469915d8c9ba4cd3b918f16782edf0de, which was released in Bitcoin Core 0.13.0. So all currently supported versions of Bitcoin Core ship without this feature. I am not aware of any complaints about this feature or actual documented use-cases. So instead of reviving an unneeded feature, just remove the dead code. ACKs for top commit: hebasto: ACK facb71576cd4d2e90fd03e09d29b42fa3d730e8c, locally running the unit and functional tests. Tree-SHA512: bfceae6f2983c1510fa0649a9a63c343cbbc1c4ab3a3698039cccf454c81e58c8f5114b147ed42a1bc867da74c43a5b53764ab14f942e191b6f59079044108b5
2020-02-27test: Disable mockforward scheduler unit test for nowMarcoFalke
2020-02-26Merge #18206: tests: Add fuzzing harness for bloom filter classes ā†µMarcoFalke
(CBloomFilter + CRollingBloomFilter) eabbbe409f397e97b1e6fad7385d9d1813ae2880 tests: Add fuzzing harness for rolling bloom filter class CRollingBloomFilter (practicalswift) 2a6a6ea0f5b97cba95b5678268d638c81764b9b1 tests: Add fuzzing harness for bloom filter class CBloomFilter (practicalswift) Pull request description: Add fuzzing harness for bloom filter classes (`CBloomFilter` + `CRollingBloomFilter`). Test this PR using: ``` $ make distclean $ ./autogen.sh $ CC=clang CXX=clang++ ./configure --enable-fuzz \ --with-sanitizers=address,fuzzer,undefined $ make $ src/test/fuzz/bloom_filter ā€¦ $ src/test/fuzz/rolling_bloom_filter ā€¦ ``` ACKs for top commit: MarcoFalke: ACK eabbbe409f397e97b1e6fad7385d9d1813ae2880 šŸ¤ž Tree-SHA512: 765d30bc52e3eb04dbd4d2b8f517387aa61312416e8fea3767250ef5c074e08641699019ee4600d42303de32f98379c20bfc0c0e60cb5154d0338088c1d29cb6
2020-02-25tests: Add fuzzing harness for rolling bloom filter class CRollingBloomFilterpracticalswift
2020-02-25tests: Add fuzzing harness for bloom filter class CBloomFilterpracticalswift
2020-02-25Merge #17264: rpc: set default bip32derivs to true for psbt methodsSamuel Dobson
5bad7921d0b33b62c0a59a478c2e8c869fc5e3b5 [test] PSBT RPC: check that bip32_derivs are present by default (Sjors Provoost) 29a21c90610aed88b796a7a5900e42e9048b990e [rpc] set default bip32derivs to true for psbt methods (Sjors Provoost) Pull request description: In https://github.com/bitcoin/bitcoin/pull/13557#pullrequestreview-135905054 I recommended not including bip32 deriviation by default in PSBTs: > _Bit of a privacy issue_: let's say person A and B are about to spend from a multisig address, sending everything to person A. Person A gives their address to person B, their wallet wallet creates a PSBT, but doesn't sign it. Wallet A then calls `walletprocesspsbt` which signs it and _spontaneously adds the master_fingerprint and bip32 path_. Same issue with `walletcreatefundedpsbt`. > > Adding `bip32_derivs` should probably be opt-in. In practice I find this default quite annoying because I forget it and end up with a confused hardware wallet. More importantly, in the multisig example I provided, it's actually essential for the other side to know the derivation details (in addition to an xpub). This allows them to check that change is going to an address you can still co-sign for (because the spending policy is unchanged except for an index). ACKs for top commit: instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/17264/commits/5bad7921d0b33b62c0a59a478c2e8c869fc5e3b5 jonatack: ACK 5bad7921d0 code review, built, ran tests, inspected/messed around with/pprinted values from the new tests. Thanks for adding the tests. meshcollider: utACK 5bad7921d0b33b62c0a59a478c2e8c869fc5e3b5 Tree-SHA512: 22ad71dda96856060a96758c4ae7aafa22d5e9efba30e0c8287c711e7579849bd72593cbc0f41a2e9e8821315d78bda04e848dbb006283b841b2795e2faebcfd
2020-02-25Merge #17577: refactor: deduplicate the message sign/verify codeSamuel Dobson
e193a84fb28068e38d5f54fbfd6208428c5bb655 Refactor message hashing into a utility function (Jeffrey Czyz) f8f0d9893d7969bdaa870fadb94ec5d0dfa8334d Deduplicate the message signing code (Vasil Dimov) 2ce3447eb1e25ec7aec4b300dabf6c1e394f1906 Deduplicate the message verifying code (Vasil Dimov) Pull request description: The message signing and verifying logic was replicated in a few places in the code. Consolidate in a newly introduced `MessageSign()` and `MessageVerify()` and add unit tests for them. ACKs for top commit: Sjors: re-ACK e193a84fb28068e38d5f54fbfd6208428c5bb655 achow101: ACK e193a84fb28068e38d5f54fbfd6208428c5bb655 instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/17577/commits/e193a84fb28068e38d5f54fbfd6208428c5bb655 meshcollider: utACK e193a84fb28068e38d5f54fbfd6208428c5bb655 Tree-SHA512: b0e02a7d4623a98c8f8c77627af1725e6df07700de4630c2f75da6beacdf55414c38ba147bc6d2a757491ab07c827dddf93e8632fe600478760e255714ddab88
2020-02-25Merge #18162: util: Avoid potential uninitialized read in ā†µfanquake
FormatISO8601DateTime(int64_t) by checking gmtime_s/gmtime_r return value 12a2f377185a413b740460db36812de22ee2e041 util: Avoid potential uninitialized read in FormatISO8601DateTime(int64_t nTime) by checking gmtime_s/gmtime_r return value (practicalswift) Pull request description: Avoid potential uninitialized read in `FormatISO8601DateTime(int64_t)` by checking `gmtime_s`/`gmtime_r` return value. Before this patch `FormatISO8601DateTime(67768036191676800)` resulted in: ``` ==5930== Conditional jump or move depends on uninitialised value(s) ==5930== at 0x4F44C0A: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25) ==5930== by 0x4F511A4: std::ostream& std::ostream::_M_insert<long>(long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25) ==5930== by 0x4037C3: void tinyformat::formatValue<int>(std::ostream&, char const*, char const*, int, int const&) (tinyformat.h:358) ==5930== by 0x403725: void tinyformat::detail::FormatArg::formatImpl<int>(std::ostream&, char const*, char const*, int, void const*) (tinyformat.h:543) ==5930== by 0x402E02: tinyformat::detail::FormatArg::format(std::ostream&, char const*, char const*, int) const (tinyformat.h:528) ==5930== by 0x401B16: tinyformat::detail::formatImpl(std::ostream&, char const*, tinyformat::detail::FormatArg const*, int) (tinyformat.h:907) ==5930== by 0x4017AE: tinyformat::vformat(std::ostream&, char const*, tinyformat::FormatList const&) (tinyformat.h:1054) ==5930== by 0x401765: void tinyformat::format<int, int, int, int, int, int>(std::ostream&, char const*, int const&, int const&, int const&, int const&, int const&, int const&) (tinyformat.h:1064) ==5930== by 0x401656: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<int, int, int, int, int, int>(char const*, int const&, int const&, int const&, int const&, int const&, int const&) (tinyformat.h:1073) ==5930== by 0x4014CC: FormatISO8601DateTime[abi:cxx11](long) (ā€¦) ``` The same goes for other very large positive and negative arguments. Fix by simply checking the `gmtime_s`/`gmtime_r` return value :) ACKs for top commit: MarcoFalke: ACK 12a2f377185a413b740460db36812de22ee2e041 theStack: re-ACK https://github.com/bitcoin/bitcoin/commit/12a2f377185a413b740460db36812de22ee2e041 elichai: re ACK 12a2f377185a413b740460db36812de22ee2e041 Tree-SHA512: 066142670d9bf0944d41fa3f3c702b1a460b5471b93e76a619b1e818ff9bb9c09fe14c4c37e9536a04c99533f7f21d1b08ac141e1b829ff87ee54c80d0e61d48
2020-02-24Merge #18193: scripted-diff: Wallet: Rename incorrectly named *UsedDestinationMarcoFalke
bca8665d0895c450e552c357a036d9e9579e3678 scripted-diff: Wallet: Rename incorrectly named *UsedDestination (Luke Dashjr) Pull request description: These functions are used to mark/check if a key of our own has been used to spend (and only for avoid-reuse wallets), which has nothing to do with the destination/address itself. Give them more accurate names to avoid confusion. -BEGIN VERIFY SCRIPT- sed -i -e 's/UsedDestination/SpentKey/g' $(git grep -l 'UsedDestination' ./src) -END VERIFY SCRIPT- ACKs for top commit: practicalswift: ACK bca8665d0895c450e552c357a036d9e9579e3678 -- patch looks correct and rationale makes sense instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/18193/commits/bca8665d0895c450e552c357a036d9e9579e3678, much more meaningful name, thanks kallewoof: ACK bca8665d0895c450e552c357a036d9e9579e3678 Tree-SHA512: ff13d9061ffa748e92eb41ba962c3ec262a43e4b6abd62408b38c6f650395d6ae5851554257d1900fb02767a88d08380d592a27210192ee9abb72d0945976686
2020-02-22test: Add cost_of_change parameter assertions to bnb_search_testYancy Ribbens
2020-02-22Merge #18181: test: Remove incorrect assumptions in validation_flush_testsMarcoFalke
faca8eff39876cc8c0ee609a89bdcebc21976d47 test: Remove incorrect assumptions in validation_flush_tests (MarcoFalke) fa31eebfe9107e14dc1d6b588f5b4c878d1010de test: Tabs to spaces in all tests (MarcoFalke) Pull request description: The tests assume standard library internals that may not hold on all supported archs or when the code is instrumented for sanitizer or debug use cases Fixes #18111 ACKs for top commit: jamesob: ACK https://github.com/bitcoin/bitcoin/pull/18181/commits/faca8eff39876cc8c0ee609a89bdcebc21976d47 pending passing tests fjahr: ACK faca8eff39876cc8c0ee609a89bdcebc21976d47 Tree-SHA512: 60a5ae824bdffb0762f82f67957b31b185385900be5e676fcb12c23d53f5eea734601680c2e3f0bdb8052ce90e7ca1911b1342affb67e43d91a506b111406f41
2020-02-21Merge #18183: test: Set catch_system_errors=no on boost unit testsMarcoFalke
fac52dafa013047b051ca7163cc30ac69ad35531 test: Set catch_system_errors=no on boost unit tests (MarcoFalke) Pull request description: Closes #16700 Can be tested by adding an `assert(0)` and then running either `make check` or `./src/test/test_bitcoin -t bla_tests --catch_system_errors=no/yes` ACKs for top commit: practicalswift: ACK fac52dafa013047b051ca7163cc30ac69ad35531 Empact: Tested ACK https://github.com/bitcoin/bitcoin/pull/18183/commits/fac52dafa013047b051ca7163cc30ac69ad35531 Tree-SHA512: ec00636951b2c1137aaf43610739d78d16f823f7da76a726d47f93b8b089766fb66b21504b3c5413bcf8b6b5c3db0ad74027d677db24a44487d6d79a6bdee2e0
2020-02-21scripted-diff: Wallet: Rename incorrectly named *UsedDestinationLuke Dashjr
These functions are used to mark/check if a key of our own has been used to spend (and only for avoid-reuse wallets), which has nothing to do with the destination/address itself. Give them more accurate names to avoid confusion. -BEGIN VERIFY SCRIPT- sed -i -e 's/UsedDestination/SpentKey/g' $(git grep -l 'UsedDestination' ./src) -END VERIFY SCRIPT-
2020-02-22Merge #18034: Get the OutputType for a descriptorSamuel Dobson
7e80f646b24a2abf3c031a649bcc706a695f80da Get the OutputType for a descriptor (Andrew Chow) Pull request description: Adds a `GetOutputType()` method to get the OutputType of a descriptor. Some descriptors don't have a determinate OutputType, so we actually use an `Optional<OutputType>`. For descriptors with indeterminate OutputType, we return `nullopt`. `addr()` and `raw()` use OutputTypes as determined by the CTxDestination they have. For simplicity, `ScriptHash` destinations are `LEGACY` even though they could be `P2SH_SEGWIT`. `combo()`, `pk()`, and `multi()` are `nullopt` as they either don't have an OutputType or they have multiple. `DescriptorImpl` defaults to `nullopt`. `pkh()` is `LEGACY` as expected `wpkh()` and `wsh()` are `BECH32` as expected. `sh()` checks whether the sub-descriptor is `BECH32`. If so, it is `P2SH_SEGWIT`. Otherwise it is `LEGACY`. The descriptor tests are updated to check the OutputType too. ACKs for top commit: fjahr: ACK 7e80f646b24a2abf3c031a649bcc706a695f80da meshcollider: utACK 7e80f646b24a2abf3c031a649bcc706a695f80da instagibbs: cursory ACK https://github.com/bitcoin/bitcoin/pull/18034/commits/7e80f646b24a2abf3c031a649bcc706a695f80da Sjors: Code review ACK 7e80f646b24a2abf3c031a649bcc706a695f80da jonatack: ACK 7e80f64 code review/build/tests Tree-SHA512: c5a813447b62e982435e1c948066f8d6c148c9ebffb0a5eb5a9028b173b01d5ead2f076a5ca3f7f37698538baa346f82a977ee48f583d89cb4e5ebd9111b2341
2020-02-20Merge #18122: rpc: update validateaddress RPCExamples to bech32fanquake
7f1475c7119e8c72bce39a63386a6ca859066b80 rpc: update validateaddress RPCExamples to bech32 (Sebastian Falbesoner) Pull request description: Another small step to get rid of legacy addresses in the RPC help texts and by that encourage the use of bech32 addresses by default. The (invalid) address is the same as in the `getaddressinfo` RPC (see 2ee0cb3330ccf70f0540cb42370796e32eff1569, kudos to jonatack!), I don't think it adds any value to have a different example address per RPC. ACKs for top commit: fanquake: ACK 7f1475c7119e8c72bce39a63386a6ca859066b80 MarcoFalke: ACK 7f1475c7119e8c72bce39a63386a6ca859066b80 Tree-SHA512: 2350f61fa942a9053f9f5c860ea446965dc7209c71c81bdb98a859d03ca23b225ad72c9c506e4a55c8d8988823d9cfbe808c1a452a1eeadb70ab186b146dd4ca
2020-02-19test: Set catch_system_errors=no on boost unit testsMarcoFalke
2020-02-19util: Avoid potential uninitialized read in FormatISO8601DateTime(int64_t ā†µpracticalswift
nTime) by checking gmtime_s/gmtime_r return value
2020-02-19test: Remove incorrect assumptions in validation_flush_testsMarcoFalke
2020-02-19test: Tabs to spaces in all testsMarcoFalke
Spaces are used in all of the source code except in these two instances
2020-02-19Add static_asserts to ser_X_to_Y() methodsSamer Afach
2020-02-19Merge #18067: wallet: Improve LegacyScriptPubKeyMan::CanProvide script ā†µSamuel Dobson
recognition a304a3632f0437f4d0f04589a2200e2da91624a7 Revert "Store p2sh scripts in AddAndGetDestinationForScript" (Russell Yanofsky) eb7d8a5b07e89133a5fb465ad1b793362e7439f7 [test] check for addmultisigaddress regression (Sjors Provoost) 005f8a92ccb5bc10c8daa106d75e1c21390461d3 wallet: Improve LegacyScriptPubKeyMan::CanProvide script recognition (Russell Yanofsky) Pull request description: Make `LegacyScriptPubKeyMan::CanProvide` method able to recognize p2sh scripts when the redeem script is present in the `mapScripts` map without the p2sh script also having to be added to the `mapScripts` map. This restores behavior prior to #17261, which I think broke backwards compatibility with old wallet files by no longer treating addresses created by `addmultisigaddress` calls before #17261 as solvable. The reason why tests didn't fail with the CanProvide implementation in #17261 is because of a workaround added in 4a7e43e8460127a40a7895519587399feff3b682 "Store p2sh scripts in AddAndGetDestinationForScript", which masked the problem for new `addmultisigaddress` RPC calls without fixing it for multisig addresses already created in old wallet files. This change adds a lot of comments and allows reverting commit 4a7e43e8460127a40a7895519587399feff3b682 "Store p2sh scripts in AddAndGetDestinationForScript", so the `AddAndGetDestinationForScript()` function, `CanProvide()` method, and `mapScripts` map should all be more comprehensible ACKs for top commit: Sjors: re-ACK a304a3632f0437f4d0f04589a2200e2da91624a7 (rebase, slight text changes and my test) achow101: re-ACK a304a3632f0437f4d0f04589a2200e2da91624a7 meshcollider: utACK a304a3632f0437f4d0f04589a2200e2da91624a7 Tree-SHA512: 03b625220c49684c376a8062d7646aeba0e5bfe043f977dc7dc357a6754627d594e070e4d458d12d2291888405d94c1dbe08c7787c318374cedd5755e724fb6e
2020-02-17Merge #18037: Util: Allow scheduler to be mockedMarcoFalke
8bca30ea17cd4c1dacee28eaa27e5fa3493b021d [rpc] expose ability to mock scheduler via the rpc (Amiti Uttarwar) 7c8b6e5b5206a98f86675d0107ad99ea1d080466 [lib] add scheduler to node context (Amiti Uttarwar) 930d8375421451c8c4127608c360b0f6a0a62127 [test] add chainparams property to indicate chain allows time mocking (Amiti Uttarwar) 1cd43e83c6e8d81e950aaaede7a8a51505d0a2bc [test] unit test for new MockForward scheduler method (Amiti Uttarwar) a6f63598adb880a75e1571aac58338c17fa7ad53 [util] allow scheduler to be mocked (Amiti Uttarwar) Pull request description: This PR is to support functional tests by allowing the scheduler to be mocked via the RPC. It adds a `MockForward` method to the scheduler class that iterates through the task queue and reschedules them to be `delta_seconds` sooner. This is currently used to support functional testing of the "unbroadcast" set tracking in #18038. If this patch is accepted, it would also be useful to simplify the code in #16698. ACKs for top commit: MarcoFalke: ACK 8bca30ea17cd4c1dacee28eaa27e5fa3493b021d, only change is some style fixups šŸ•“ Tree-SHA512: 2a97fe8ade2b7fd1fb5cdfa1dcafb3227a377d7a847e3845a228bc119eb77824b4aefa43d922a06d583939b22725e223f308cf092961048079d36f6b1d9a639b
2020-02-17[rpc] expose ability to mock scheduler via the rpcAmiti Uttarwar
2020-02-17[lib] add scheduler to node contextAmiti Uttarwar
- also update test setup & access point in denial of service test
2020-02-17Fix a violation of C++ standard rules that unions cannot be switched.Samer Afach
2020-02-17Merge #13339: wallet: Replace %w by wallet name in -walletnotify scriptWladimir J. van der Laan
4e9efac678a9c0ea4e4c7dd956ea036ae6cf17ec test: Check wallet name in -walletnotify script (JoĆ£o Barbosa) 9a5b5ee81f15b1d89cb25ff3e137a672536cdc46 wallet: Replace %w by wallet name in -walletnotify script (JoĆ£o Barbosa) Pull request description: Fixes #13237. ACKs for top commit: laanwj: ACK 4e9efac678a9c0ea4e4c7dd956ea036ae6cf17ec Tree-SHA512: 189dd1c785485f2e974d7c12531851b2a977778b3b954aa95efd527322ba3345924cfd587fb9c90b0fa979202af0ab2d90e53d125fe266a36c94f757e4176203