aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-01-08Merge #17677: Activate watchonly wallet behavior for LegacySPKM onlySamuel Dobson
e1e1442f3eadc1d139380e71c1b60b86d8d6bdee Activate no-privkey -> ISMINE_WATCH_ONLY behavior for LegacySPKM only (Gregory Sanders) Pull request description: Slight cleanup following https://github.com/bitcoin/bitcoin/pull/16944 This should allow future scriptpubkeymans to transparently work, since the current plan is to have ismine always be spendable. ACKs for top commit: achow101: ACK e1e1442f3eadc1d139380e71c1b60b86d8d6bdee Sjors: Code review ACK e1e1442f3eadc1d139380e71c1b60b86d8d6bdee meshcollider: Code review ACK e1e1442f3eadc1d139380e71c1b60b86d8d6bdee Tree-SHA512: c0a86587d33b8b1646494a5cb0bf8681ee4a88e6913918157746943a0996b501903e0e6ee954cf04154c1e0faee0cbb375c74ca789f46ba9244eb5296632b042
2020-01-08Merge #17578: rpc: simplify getaddressinfo labels, deprecate previous behaviorSamuel Dobson
8925df86c4df16b1070343fef8e4d238f3cc3bd1 doc: update release notes (Jon Atack) 8bb405bbadf11391ccba7b334b4cfe66dc85b390 test: getaddressinfo labels purpose deprecation test (Jon Atack) 60aba1f2f11529add115d963d05599130288ae28 rpc: simplify getaddressinfo labels, deprecate previous behavior (Jon Atack) 7851f14ccf2bcd1e9b2ad48e5e08881be06d9d21 rpc: incorporate review feedback from PR 17283 (Jon Atack) Pull request description: This PR builds on #17283 (now merged) and is followed by #17585. It modifies the value returned by rpc getaddressinfo `labels` to an array of label name strings and deprecates the previous behavior of returning an array of JSON hash structures containing label `name` and address `purpose` key/value pairs. before ``` "labels": [ { "name": "DOUBLE SPEND", "purpose": "receive" } ``` after ``` "labels": [ "DOUBLE SPEND" ] ``` The deprecated behavior can be re-enabled by starting bitcoind with `-deprecatedrpc=labelspurpose`. For context, see: - https://github.com/bitcoin/bitcoin/pull/17283#issuecomment-554458001 - http://www.erisian.com.au/bitcoin-core-dev/log-2019-12-13.html#l-425 (lines 425-427) - http://www.erisian.com.au/bitcoin-core-dev/log-2019-11-22.html#l-622 Reviewers: This PR may be tested manually by building, then running bitcoind with and without the `-deprecatedrpc=labelspurpose` flag while verifying the rpc getaddressinfo help text and `labels` output. Next steps: deprecate the rpc getaddressinfo `label` field (EDIT: done in #17585) and add support for multiple labels per address. This PR will unblock those. ACKs for top commit: jnewbery: reACK 8925df8 promag: Code review ACK 8925df86c4df16b1070343fef8e4d238f3cc3bd1. meshcollider: Code review ACK 8925df86c4df16b1070343fef8e4d238f3cc3bd1 Tree-SHA512: c2b717209996da32b6484de7bb8800e7048410f9ce6afdb3e02a6866bd4a8f2c730f905fca27b10b877b91cf407f546e69e8c4feb9cd934325a6c71c166bd438
2020-01-08Merge #16373: bumpfee: Return PSBT when wallet has privkeys disabledSamuel Dobson
091a876664af4427db670ea8244d713b1b840048 Test watchonly wallet bumpfee with PSBT return (Gregory Sanders) e9b4f9419cc778b5164708991a55014abef6c5f9 bumpfee: Return PSBT when wallet has privkeys disabled (Gregory Sanders) 75a5e478b631d3d0821d003300c4eae3c8433973 Change bumpfee to use watch-only funds for legacy watchonly wallets (Gregory Sanders) Pull request description: The main use-case here is for using with watch-only wallets with PSBT-signing cold wallets of all kinds. ACKs for top commit: achow101: ACK 091a876664af4427db670ea8244d713b1b840048 Sjors: Tested ACK 091a876664af4427db670ea8244d713b1b840048 meshcollider: utACK 091a876664af4427db670ea8244d713b1b840048 Tree-SHA512: f7cf663e1af0b029e5c99eac88c5fdc3bc9e9a3841da8a608e8a9957e9bcf6a78864b8c2706fcaf78a480ffe11badd80c4fad29f97c0bb929e0470fafda5c22e
2020-01-08Merge #17621: IsUsedDestination should count any known single-key addressSamuel Dobson
09502452bbbe21bb974f1de8cf53196373921ab9 IsUsedDestination should count any known single-key address (Gregory Sanders) Pull request description: This plugs the privacy leak detailed at https://github.com/bitcoin/bitcoin/issues/17605, at least for the single-key case. ACKs for top commit: meshcollider: Code Review ACK 09502452bbbe21bb974f1de8cf53196373921ab9 Tree-SHA512: e1d68281675f05072b3087171cba1df9416a69c9ccf70c72e8555e55eadda2d0fd339e5a894e3a3438ff94b9e3827fb19b8b701faade70c08756b19ff157ee0c
2020-01-06Merge #17857: scripts: fix symbol-check & security-check argument passingfanquake
71af793512100ee7d508c3fb815af47925fe80ba scripts: fix check-symbols & check-security argument passing (fanquake) Pull request description: The first argument in `bin_PROGRAMS` (`bitcoind`) was being silently consumed and never passed into the [`security-check.py`](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/security-check.py) or [`symbol-check.py`](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/symbol-check.py) scripts. This seems to have been the case since the scripts were added to the makefile in https://github.com/bitcoin/bitcoin/commit/f3d3eaf78eb51238d799d8f20a585550d1567719. Example of the behavior: ```python # touch a, touch b, touch c # python3 args.py < a b c import sys if __name__ == '__main__': print(sys.argv) # ['args.py', 'b', 'c'] # if you add some lines to "a", # you'll see them here.. for line in sys.stdin: print(line) ``` ACKs for top commit: laanwj: ACK 71af793512100ee7d508c3fb815af47925fe80ba Tree-SHA512: 9d0b975a11f66fd87a76654d210808000a629c9cce4c760f71e8a2bcb4e99b9109419f2306db67cf9b12c28e40b96ae722b7c9b4569b2b8bacd469fb99db30c3
2020-01-05Merge #17869: refactor: Remove unused defines in qt/bitcoinunits.hfanquake
7754d7ab1e4f1918fcc31396cd3e7507f936477f refactor: Remove unused defines in bitcoinunits.h (Hennadii Stepanov) Pull request description: In `bitcoinunits.h` some `#define`s introduced in #4167 are unused now. ACKs for top commit: emilengler: ACK 7754d7ab1e4f1918fcc31396cd3e7507f936477f fanquake: ACK 7754d7ab1e4f1918fcc31396cd3e7507f936477f promag: ACK 7754d7ab1e4f1918fcc31396cd3e7507f936477f. Tree-SHA512: 688836a434d87530f99c309d8af60f63cdfdcfe583c9297636fbbed0f16a3dc0920d4249457303c00a83dc82d28edd8a99aab0b191c7ffbbd38c5d9fc8ee0df1
2020-01-04Merge #17850: Serialization improvements (minimal initial commits)Wladimir J. van der Laan
9250a087d2f450f37342010aea0a5d583eea508b Convert addrdb/addrman to new serialization (Pieter Wuille) ca33451535dc29f64d37c49af8b22142d7716d0d Introduce new serialization macros without casts (Pieter Wuille) Pull request description: This is a minimal subset of #10785 that still does *something*. It adds a new saner serialization macro, which can be used in parallel with the old one. Then the addrdb code is converted to use this new macro. I'll add follow-up PRs that add more functionality + converting of other modules as things get merged. ACKs for top commit: jamesob: ACK 9250a087d2f450f37342010aea0a5d583eea508b ([`jamesob/ackr/17850.1.sipa.serialization_improvemen`](https://github.com/jamesob/bitcoin/tree/ackr/17850.1.sipa.serialization_improvemen)) kallewoof: ACK 9250a087d2f450f37342010aea0a5d583eea508b laanwj: code review ACK 9250a087d2f450f37342010aea0a5d583eea508b Tree-SHA512: d4f58c7f85d8ada7543ee43159be57d320746abe003af11395508d280d339fac7faa198e707d1a689fb0a775fc36b3945178c3ae1c0cf9ffe685773c6ddc10c1
2020-01-04refactor: Remove unused defines in bitcoinunits.hHennadii Stepanov
2020-01-03IsUsedDestination should count any known single-key addressGregory Sanders
2020-01-03rpc: simplify getaddressinfo labels, deprecate previous behaviorJon Atack
- change the value returned in the RPC getaddressinfo `labels` field to an array of label name strings - deprecate the previous behavior of returning a JSON hash structure containing label `name` and address `purpose` key/value pairs - update the relevant tests
2020-01-03scripts: fix check-symbols & check-security argument passingfanquake
The first argument in bin_PROGRAMS (bitcoind) was being silently dropped and never passed into the check-security.py or check-symbols.py scripts. This has been the case since the scripts were added to the makefile in https://github.com/bitcoin/bitcoin/commit/f3d3eaf78eb51238d799d8f20a585550d1567719. Example of the behavior: ```python # touch a, touch b, touch c # python3 args.py < a b c import sys if __name__ == '__main__': print(sys.argv) # ['args.py', 'b', 'c'] # if you add some lines to "a", # you'll see them here.. for line in sys.stdin: print(line) ```
2020-01-02Merge #17781: rpc: Remove mempool global from minerMarcoFalke
faa92a2297b4a6aebdd58d1818c428f1c0346078 rpc: Remove mempool global from miner (MarcoFalke) 6666ef13f167cfe880c2e94c09d003594d010cf3 test: Properly document blockinfo size in miner_tests (MarcoFalke) Pull request description: The miner needs read-only access to the mempool. Instead of using the mutable global `::mempool`, keep a immutable reference to a mempool that is passed to the miner. Apart from the obvious benefits of removing a global and making things immutable, this might also simplify testing with multiple mempools. ACKs for top commit: promag: ACK faa92a2297b4a6aebdd58d1818c428f1c0346078. fjahr: ACK faa92a2297b4a6aebdd58d1818c428f1c0346078 jnewbery: Code review ACK faa92a2297b4a6aebdd58d1818c428f1c0346078 Tree-SHA512: c44027b5d2217a724791166f3f3112c45110ac1dbb37bdae27148a0657e0d1a1d043b0d24e49fd45465ec014224d1b7eb15c92a33069ad883fa8ffeadc24735b
2020-01-02Merge #17762: net: Log to net category for exceptions in ProcessMessagesWladimir J. van der Laan
4bdd68f301a9cee3360deafc7531c638e923226b Add missing typeinfo includes (Wladimir J. van der Laan) 4d88c3dcb61e7c075ed3dd442044e0eff4e3c8de net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan) Pull request description: Remove the forest of special exceptions based on string matching, and simply log a short message to the NET logging category when an exception happens during packet processing. It is not good to panick end users with verbose errors (let alone writing to stderr) when any peer can generate them. ACKs for top commit: MarcoFalke: re-ACK 4bdd68f301a9cee3360deafc7531c638e923226b (only change is adding includes) 🕕 promag: ACK 4bdd68f301a9cee3360deafc7531c638e923226b, could squash. Tree-SHA512: a005591a3202b005c75e01dfa54249db3992e2f9eefa8b3d9d435acf66130417716ed926ce4e045179cf43788f1abc7362d999750681a9c80b318373d611c366
2020-01-02Add missing typeinfo includesWladimir J. van der Laan
The use of `typeid()` for logging exception types requires this include according to https://en.cppreference.com/w/cpp/language/typeid.
2020-01-02Convert addrdb/addrman to new serializationPieter Wuille
2020-01-02Introduce new serialization macros without castsPieter Wuille
This new approach uses a static method which takes the object as a argument. This has the advantage that its constness can be a template parameter, allowing a single implementation that sees the object as const for serialization and non-const for deserialization, without casts. More boilerplate is included in the new macro as well.
2020-01-02Merge #16658: validation: Rename CheckInputs to CheckInputScriptsMarcoFalke
3bd8db80d8d335ab63ece4f110b0fadd562e80b7 [validation] fix comments in CheckInputScripts() (John Newbery) 6f6465cefcd599c89c00f7b51f42a4b87a5ffb0b scripted-diff: [validation] Rename CheckInputs to CheckInputScripts (John Newbery) Pull request description: CheckInputs() used to check no double spends, scripts & sigs and amounts. Since 832e074, the double spend and amount checks have been moved to CheckTxInputs(), and CheckInputs() now just validates input scripts. Rename the function to CheckInputScripts(). Also fix incorrect comments. ACKs for top commit: MarcoFalke: re-ACK 3bd8db80d8d335ab63ece4f110b0fadd562e80b7, did the rebase myself, checked the scripted diff 👡 promag: ACK 3bd8db80d8d335ab63ece4f110b0fadd562e80b7 :trollface: Tree-SHA512: 7b3f8597d210492798fb784ee8ea47ea6377519111190161c7cc34a967509013f4337304f52e9bedc97b7710de7b0ff8880e08cd7f867754567f82e7b02c794c
2020-01-02scripts: add MACHO PIE check to security-check.pyfanquake
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-12-28rpc: incorporate review feedback from PR 17283Jon Atack
- (reverted after follow-on review by maintainers: provide a valid address in getaddressinfo RPCExample) - remove unneeded code comments
2019-12-23rpc: Remove mempool global from minerMarcoFalke
2019-12-20test: Properly document blockinfo size in miner_testsMarcoFalke
This fixes a typo in the test documentation
2019-12-20Merge #17473: refactor: Settings code cleanupsMarcoFalke
e9fd366044e271632dc0e4f96e1c14f8e87213ae refactor: Remove null setting check in GetSetting() (Russell Yanofsky) cba2710220d76bbe790b04088839cbbd410436de scripted-diff: Remove unused ArgsManager type flags in tests (Russell Yanofsky) 425bb307252cf4dec9b3ef6426e6548b2be7a303 refactor: Add util_CheckValue test (Russell Yanofsky) 0fa54358b06b58f4d17073bcc8a959eb9498aadc refactor: Add ArgsManager::GetSettingsList method (Russell Yanofsky) 3e185522ace1678e0a25b9cf8a5553a4bc279bea refactor: Get rid of ArgsManagerHelper class (Russell Yanofsky) dc0f1480746b34aa3ca2d9c0f1ec764083026b40 refactor: Replace FlagsOfKnownArg with GetArgFlags (Russell Yanofsky) 57e8b7a7273567aa4a4aee87cce18e9bff8f3196 refactor: Clean up includeconf comments (Russell Yanofsky) 3f7dc9b808316c1e5d677af8d9a99112568c8ccb refactor: Clean up long lines in settings code (Russell Yanofsky) Pull request description: This PR doesn't change behavior. It just implements some suggestions from #15934 and #16545 and few other small cleanups. ACKs for top commit: jnewbery: Code review ACK e9fd366044e271632dc0e4f96e1c14f8e87213ae MarcoFalke: ACK e9fd366044 🚟 Tree-SHA512: 6e100d92c72f72bc39567187ab97a3547b3c06e5fcf1a1b74023358b8bca552124ca6a53c0ab53179b7f1329c03d9a73faaef6d73d2cd1a2321568a0286525e2
2019-12-18bumpfee: Return PSBT when wallet has privkeys disabledGregory Sanders
2019-12-18Change bumpfee to use watch-only funds for legacy watchonly walletsGregory Sanders
2019-12-17Merge #17537: wallet: Cleanup and move opportunistic and superfluous TopUp()sfanquake
6e77a7b65cda1b46ce42f0c99ca91562255aeb28 keypool: Add comment about TopUp and when to use it (Andrew Chow) ea50e34b287e0da0806c1116bb55ade730e8ff6c keypool: Move opportunistic TopUps from LegacyScriptPubKeyMan to CWallet and ReserveDestination (Andrew Chow) bb2c8ce23c9d7ba8d0e5538243e07218443c85b4 keypool: Remove superfluous topup from CWallet::GetNewChangeDestination (Andrew Chow) Pull request description: * The `TopUp()` in `CWallet::GetNewChangeDestination` is unnecessary as currently m_spk_man calls TopUp further down the call stack inside LegacyScriptPubKeyMan::ReserveKeyFromKeyPool (called by LegacyScriptPubKeyMan::GetReservedDestination). This also lets us prepare for future changes with multiple ScriptPubKeyMans in the wallet. * An opportunistic `TopUp()` is moved from `LegacyScriptPubKeyMan::GetNewDestination` to `CWallet::GetNewDestination`. * Another opportunistic `TopUp()` is moved from `LegacyScriptPubKeyMan::ReserveKeyFromKeyPool` Moving opportunistic TopUps ensures that ScriptPubKeyMans will always be topped up before requesting Destinations from them as we cannot always rely on future ScriptPubKeyMan implementaions topping up internally. See also: https://github.com/bitcoin/bitcoin/pull/17373#discussion_r348598174 ACKs for top commit: instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/17537/commits/6e77a7b65cda1b46ce42f0c99ca91562255aeb28 only change is slight elaboration on comment ryanofsky: Code review ACK 6e77a7b65cda1b46ce42f0c99ca91562255aeb28. Only the comment changed since my previous review. Tree-SHA512: bdfc8d303842c3fb7c3d40af7abfa6d9dac4ef71a24922bb92229674ee89bfe3113ebb46d3903ac48ef99f0a7d6eaac33282495844f2b31f91b8df55084c421f
2019-12-17net: Log to net category for exceptions in ProcessMessagesWladimir J. van der Laan
Remove the forest of special exceptions, and simply log a short message to the NET logging category when an exception happens during packet processing. It is not good to panick end users with errors that any peer can generate (let alone writing to stderr).
2019-12-16test: add IsRFC2544 testsMark Tyneway
2019-12-16CNetAddr: fix IsRFC2544 commentMark Tyneway
2019-12-16tests: Add fuzzing harness for various hex related functionspracticalswift
2019-12-16tests: Add fuzzing harness for various Base{32,58,64} related functionspracticalswift
2019-12-16util: Move TrimString(...). Introduce default pattern (trims whitespace). ↵practicalswift
Add NODISCARD.
2019-12-16Merge #17593: test: move more utility functions into test utility libraryMarcoFalke
78e283e656bf1643944ffdb76185f3468eb25895 [test] move wallet helper functions into test library (Martin Zumsande) f613e5dfdafe708f63ebb5193c44e2bc770c6651 [test] move mining helper functions into test library (Martin Zumsande) 2cb4e8bdc7ef75ae8d95c246af1e8e1f9c7045bd [test] move string helper functions into test library (Martin Zumsande) Pull request description: This disbands `test/util.h` and `test/util.cpp` and moves the content into the test utility library recently created in #17542, so that all test utility functions are in one place. The content of the original files are split into three modules: 1) string helper functions go to `test/util/str` 2) mining helper functions go to the newly created `test/util/mining` 3) wallet helper functions go to the newly created `test/util/wallet` ACKs for top commit: MarcoFalke: ACK 78e283e656bf1643944ffdb76185f3468eb25895 🔧 Tree-SHA512: f182a61e86e76c32bcb84e37f44904d3a4a9c5a321f7a8efdda5368a6623cb8b5a5384ec4f96e67f0357b0c22099f6e3ecd0ac4cb467e3fa3f3128f8d36edfb8
2019-12-16Merge #17750: util: change GetWarnings parameter to boolMarcoFalke
7aab8d1024996c7c422bd34a8226df0117b813f7 [style] Code style fixups in GetWarnings() (John Newbery) 492c6dc1e742a62599dc6d5ba6c3896825b5144f util: change GetWarnings parameter to bool (John Newbery) 869b6314fd180856b6054fff28b5de994252c54c [qt] remove unused parameter from getWarnings() (John Newbery) Pull request description: `GetWarnings()` changes the format of the output warning string based on a passed-in string argument that can be set to "gui" or "statusbar". Change the argument to a bool: - there are only two types of behaviour, so a bool is a more natural argument type - changing the name to `verbose` does not set any expectations for the how the calling code will use the returned string (currently, `statusbar` is used for RPC warnings, not a status bar) - removes some error-handling code for when the passed-in string is not one of the two strings expected. ACKs for top commit: laanwj: code review ACK 7aab8d1024996c7c422bd34a8226df0117b813f7 practicalswift: ACK 7aab8d1024996c7c422bd34a8226df0117b813f7 -- diff looks correct :) MarcoFalke: ACK 7aab8d1024996c7c422bd34a8226df0117b813f7 otherwise. promag: Code review ACK 7aab8d1024996c7c422bd34a8226df0117b813f7. Tree-SHA512: 75882c6e3e44aa9586411b803149b36ba487f4eb9cac3f5c8f07cd9f586870bba4488a51e674cf8147f05718534f482836e6a4e3f66e0d4ef6821900c7dfd04e
2019-12-16Merge #17564: rpc: Use mempool from node context instead of globalMarcoFalke
fa8e650b525e9493bdfa393c0c3e34cb22c78c08 rest: Use mempool from node context instead of global (MarcoFalke) fa660d65d7cc401ad5bbfdc076a074de19a79329 node: Use mempool from node context instead of global (MarcoFalke) facbaf092f1ab298943206603cff6e6e3d30d452 rpc: Use mempool from node context instead of global (MarcoFalke) Pull request description: Currently they are identical, but in the future we might want to turn the mempool into a unique_ptr. Replacing the global with the mempool pointer from the node context simplifies this step. ACKs for top commit: jnewbery: Code review ACK fa8e650b5 ryanofsky: Code review ACK fa8e650b525e9493bdfa393c0c3e34cb22c78c08, Only the discussed REST server changes since the last review. Tree-SHA512: 0836f3f39cf90306455962918446e5f8612e88c32072b92afc30929aea1f17430bbda0e2b3668d36c9d6b97d63a93cf4903185194571108642b7bf5a39b89125
2019-12-16rest: Use mempool from node context instead of globalMarcoFalke
2019-12-16Merge #17071: tests: Add fuzzing harness for CheckBlock(...) and other ↵MarcoFalke
CBlock related functions 893aa207e84b74e7623243967d29f03570fdfd6f tests: Add fuzzing harness for CheckBlock(...) and other CBlock related functions (practicalswift) ec8dcb0199c6d6ae47a13abbd158f59532554adb tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus (practicalswift) Pull request description: Add fuzzing harness for `CheckBlock(...)` and other `CBlock` related functions. **Testing this PR** Run: ``` $ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined $ make $ src/test/fuzz/block … # And to to quickly verify that the relevant code regions are triggered, that the # fuzzing throughput seems reasonable, etc. $ contrib/devtools/test_fuzzing_harnesses.sh '^block$' ``` `test_fuzzing_harnesses.sh` can be found in PR #17000. Top commit has no ACKs. Tree-SHA512: 275abd46d8ac970b28d8176f59124988b1e07c070173e001acd55995b830333417f301c309199fc589da08a6ac4c03aa74650d5e1638f6e3023dfbd3c9f6921d
2019-12-16tests: Add tests for decoding/parsing of base32, base64 and money strings ↵practicalswift
containing NUL characters
2019-12-16util: Don't allow DecodeBase32(...) of strings with embedded NUL characterspracticalswift
2019-12-16util: Don't allow DecodeBase64(...) of strings with embedded NUL characterspracticalswift
2019-12-16util: Don't allow ParseMoney(...) of strings with embedded NUL characterspracticalswift
2019-12-15tests: Add fuzzing harness for CheckBlock(...) and other CBlock related ↵practicalswift
functions
2019-12-15[style] Code style fixups in GetWarnings()John Newbery
2019-12-15util: change GetWarnings parameter to boolJohn Newbery
GetWarnings() changes the format of the output warning string based on a passed-in string argument that can be set to "gui" or "statusbar". Change the argument to a bool: - there are only two types of behaviour, so a bool is a more natural argument type - changing the name to 'verbose' does not set any expectations for the how the calling code will use the returned string (currently, 'statusbar' is used for RPC warnings, not a status bar) - removes some error-handling code for when the passed-in string is not one of the two strings expected.
2019-12-15[qt] remove unused parameter from getWarnings()John Newbery
2019-12-15Merge #17728: rpc: require second argument only for scantxoutset start actionWladimir J. van der Laan
7d263571bee8c36fbe3c854b69c6f31cf1ee3b9b rpc: require second argument only for scantxoutset start action (Andrew Chow) Pull request description: It was reported on [IRC](http://www.erisian.com.au/bitcoin-core-dev/log-2019-12-11.html#l-377) that `scantxoutset`'s API was broken in 0.19.0: ``` <belcher> i think scantxoutset may have been broken in bitcoin core 0.19 ? regardless of what parameters i run it with (e.g. "scantxoutset abort", "scantxoutset status") it just returns the help doc, according to the release notes the only change was https://github.com/bitcoin/bitcoin/pull/16285/files but i dont see anything that wouldve broken it, it works fine in 0.18 <belcher> im on regtest, in case its important <harding> I can confirm `scantxoutset abort` returns the help doc on latest master. Waiting for 0.18.1 to start now to attempt to reproduce there. <harding> It looks like it's expecting a second parameter (even though that doesn't make sense with "abort"). <jonatack> Same for me as well <harding> Can also confirm that `scantxoutset abort` returns the expected result on 0.18.1. ``` As noted in the conversation, previously, the second argument of `scanobjects` is only required for the `start` action. `Stop` and `abort` actions did not and could work without them. It appears that this was broken by #16240 which enforced the size of the arguments to match the listed required arguments. To fix this issue, this PR makes the `scanobjects` argument an optional argument. Then only in the `start` action do we check whether the `scanobjects` argument is there and throw an informative error about that. Also a test is added for this case. ACKs for top commit: laanwj: ACK 7d263571bee8c36fbe3c854b69c6f31cf1ee3b9b promag: ACK 7d263571bee8c36fbe3c854b69c6f31cf1ee3b9b. Tree-SHA512: 828bdfe47f4fffa5d00a2cf88db6cea4a2714d9c49276841ca5cbdd1603b87bb6862147b86edcf36d7b40314ddb80b1a07fd399faf288572c55cc788c5cf9526
2019-12-13Merge #17654: Unbreak build with Boost 1.72.0Wladimir J. van der Laan
a64e97dd476bda7c7981979d045b0d06d6f7ce47 wallet: unbreak with boost 1.72 (Jan Beich) Pull request description: Regressed by https://github.com/boostorg/filesystem/commit/9a14c37d6f95. See [error log](http://package22.nyi.freebsd.org/data/113amd64-default-PR241449/2019-11-27_11h48m22s/logs/bitcoin-0.19.0.1.log). https://github.com/bitcoin/bitcoin/blob/35eda631ed3bd23d4a41761a85a96f925d4a6337/src/fs.h#L14 ACKs for top commit: MarcoFalke: ACK a64e97dd476bda7c7981979d045b0d06d6f7ce47 Tree-SHA512: 0aad2b8ec211bb81021a2f8cd2059364f949be716ebaf154dd97d5c2f7119f42553892e90e6c375018ff2155b996690c7520374762259778de88014cb531ad3b
2019-12-13Merge #12763: Add RPC Whitelist Feature from #12248Wladimir J. van der Laan
2081442c421cc4376e5d7839f68fbe7630e89103 test: Add test for rpc_whitelist (Emil Engler) 7414d3820c833566b4f48c6c120a18bf53978c55 Add RPC Whitelist Feature from #12248 (Jeremy Rubin) Pull request description: Summary ==== This patch adds the RPC whitelisting feature requested in #12248. RPC Whitelists help enforce application policies for services being built on top of Bitcoin Core (e.g., your Lightning Node maybe shouldn't be adding new peers). The aim of this PR is not to make it advisable to connect your Bitcoin node to arbitrary services, but to reduce risk and prevent unintended access. Using RPC Whitelists ==== The way it works is you specify (in your bitcoin.conf) configurations such as ``` rpcauth=user1:4cc74397d6e9972e5ee7671fd241$11849357f26a5be7809c68a032bc2b16ab5dcf6348ef3ed1cf30dae47b8bcc71 rpcauth=user2:181b4a25317bff60f3749adee7d6bca0$d9c331474f1322975fa170a2ffbcb176ba11644211746b27c1d317f265dd4ada rpcauth=user3:a6c8a511b53b1edcf69c36984985e$13cfba0e626db19061c9d61fa58e712d0319c11db97ad845fa84517f454f6675 rpcwhitelist=user1:getnetworkinfo rpcwhitelist=user2:getnetworkinfo,getwalletinfo, getbestblockhash rpcwhitelistdefault=0 ``` Now user1 can only call getnetworkinfo, user2 can only call getnetworkinfo or getwalletinfo, while user3 can still call all RPCs. If any rpcwhitelist is set, act as if all users are subject to whitelists unless rpcwhitelistdefault is set to 0. If rpcwhitelistdefault is set to 1 and no rpcwhitelist is set, act as if all users are subject to whitelists. Review Request ===== In addition to normal review, would love specific review from someone working on LN (e.g., @ roasbeef) and someone working on an infrastructure team at an exchange (e.g., @ jimpo) to check that this works well with their system. Notes ===== The rpc list is spelling sensitive -- whitespace is stripped though. Spelling errors fail towards the RPC call being blocked, which is safer. It was unclear to me if HTTPReq_JSONRPC is the best function to patch this functionality into, or if it would be better to place it in exec or somewhere else. It was also unclear to me if it would be preferred to cache the whitelists on startup or parse them on every RPC as is done with multiUserAuthorized. I opted for the cached approach as I thought it was a bit cleaner. Future Work ===== In a future PR, I would like to add an inheritance scheme. This seemed more controversial so I didn't want to include that here. Inheritance semantics are tricky, but it would also make these whitelists easier to read. It also might be good to add a `getrpcwhitelist` command to facilitate permission discovery. Tests ===== Thanks to @ emilengler for adding tests for this feature. The tests cover all cases except for where `rpcwhitelistdefault=1` is used, given difficulties around testing with the current test framework. ACKs for top commit: laanwj: ACK 2081442c421cc4376e5d7839f68fbe7630e89103 Tree-SHA512: 0dc1ac6a6f2f4b0be9c9054d495dd17752fe7b3589aeab2c6ac4e1f91cf4e7e355deedcb5d76d707cbb5a949c2f989c871b74d6bf129351f429569a701adbcbf
2019-12-13Merge #17721: util: Don't allow Base58 decoding of non-Base58 strings. Add ↵Wladimir J. van der Laan
Base58 tests. d945c6f5e6f61b6e289ac7da6834c18f1b677b0f util: Don't allow base58-decoding of std::string:s containing non-base58 characters (practicalswift) ff7a9992263f5a19f73097c86068b6150d213c23 tests: Add tests for base58-decoding of std::string:s containing non-base58 characters (practicalswift) Pull request description: Don't allow Base58 decoding of non-Base58 strings. Add Base58 tests. Fixes #17718. Added tests before the Base58 decoding patch: ``` $ make check … test/base58_tests.cpp(62): error: in "base58_tests/base58_DecodeBase58": check !DecodeBase58(std::string("\0invalid", 8), result) has failed test/base58_tests.cpp(67): error: in "base58_tests/base58_DecodeBase58": check !DecodeBase58(std::string("good\0bad0IOl", 12), result) has failed test/base58_tests.cpp(76): error: in "base58_tests/base58_DecodeBase58": check !DecodeBase58Check(std::string("3vQB7B6MrGQZaxCuFg4oh\00IOl", 26), result) has failed *** 3 failures are detected in the test module "Bitcoin Core Test Suite" … $ echo $? 1 ``` Added tests before the Base58 decoding patch: ``` $ make check … OK … $ echo $? 0 ``` ACKs for top commit: MarcoFalke: ACK d945c6f5e6f61b6e289ac7da6834c18f1b677b0f 🚓 laanwj: ACK d945c6f5e6f61b6e289ac7da6834c18f1b677b0f Tree-SHA512: 78fee3a18718c9cfbf2e4b26daaf8f24b4deca00475b7b254fec7f8be740f8898c696d9cd0eaa7c50bca55909b9dff3b516b6fe4db92dc132dcc0a1c5e3d61af
2019-12-13Merge #17617: doc: unify unix epoch time descriptionsWladimir J. van der Laan
d94d34f05f4ae3efa07de409489d68bbcc216346 doc: update developer notes wrt unix epoch time (Jon Atack) e2f32cb5c5c7f2b1d1fc7003587b6573fb59526a qa: unify unix epoch time descriptions (Jon Atack) Pull request description: Closes #17613. Updated call sites: mocktime, getblockheader, getblock, pruneblockchain, getchaintxstats, getblocktemplate, setmocktime, getpeerinfo, setban, getnodeaddresses, getrawtransaction, importmulti, listtransactions, listsinceblock, gettransaction, getwalletinfo, getaddressinfo Commands for testing manually: ``` bitcoind -help-debug | grep -A1 mocktime bitcoin-cli help getblockheader bitcoin-cli help getblock bitcoin-cli help pruneblockchain bitcoin-cli help getchaintxstats bitcoin-cli help getblocktemplate bitcoin-cli help setmocktime bitcoin-cli help getpeerinfo bitcoin-cli help setban bitcoin-cli help getnodeaddresses bitcoin-cli help getrawtransaction bitcoin-cli help importmulti bitcoin-cli help listtransactions bitcoin-cli help listsinceblock bitcoin-cli help gettransaction bitcoin-cli help getwalletinfo bitcoin-cli help getaddressinfo ``` ACKs for top commit: laanwj: re-ACK d94d34f05f4ae3efa07de409489d68bbcc216346 Tree-SHA512: 060713ea4e20ab72c580f06c5c7e3ef344ad9c2c9cb034987d980a54e3ed2ac0268eb3929806daa5caa7797c45f5305254fd499767db7f22862212cf77acf236