aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
AgeCommit message (Collapse)Author
2020-04-02Bugfix: RPC: JSON null is not "None"Luke Dashjr
2020-04-02Bugfix: RPC: Don't use a continuation elipsis after an elision elipsisLuke Dashjr
2020-04-02Bugfix: RPC: Add missing commas and correct indentation of explicit ELISIONLuke Dashjr
2020-03-28Merge #18444: RPC: Remove final comma for last entry of fixed-size ā†µMarcoFalke
arrays/objects in RPCResult c34164896c62fc6307b4cc72c060a277263590bb Bugfix: RPC: Remove final comma for last entry of fixed-size Arrays and Objects in RPCResult (Luke Dashjr) Pull request description: JSON doesn't allow a trailing comma in arrays Top commit has no ACKs. Tree-SHA512: 761502a05f447afc09c120f13bf23abd2aee83a7f5e5dadaf54c7e1c0c1280d83ee041ca6ca45998fb561e41b32d01067ec52a187c3bcc9d53303ea813bc212c
2020-03-28Merge #18449: util: Remove unused itostrWladimir J. van der Laan
faaf1cb5b9a4c22b21757f7578833f908b79b867 util: Replace i64tostr with ToString (MarcoFalke) fac96fff624a3ab65209dcd3378efb6e6ab47a58 util: Remove unused itostr (MarcoFalke) Pull request description: Currently unused, but if someone really needed to use a helper with this functionality in the future, they could use `ToString`. ACKs for top commit: laanwj: ACK faaf1cb5b9a4c22b21757f7578833f908b79b867 promag: Code review ACK faaf1cb5b9a4c22b21757f7578833f908b79b867. Tree-SHA512: 42180c03f51d677f7b69da23c7868bdd88944335fad0752fcc307f2c3e3c69f1cc1b316ac0875bcefb9a69c5d55200d7cf66843ea4c0f0f26baf7a054b96c1bb
2020-03-28Bugfix: RPC: Remove final comma for last entry of fixed-size Arrays and ā†µLuke Dashjr
Objects in RPCResult JSON doesn't allow a trailing comma in Arrays/Objects
2020-03-27util: Replace i64tostr with ToStringMarcoFalke
2020-03-27Merge #18398: rpc: fix broken RPCExamples for waitforblock(height)fanquake
ef35604c9c88e7800e9be106b791b1c0fa8b310a rpc: fix broken RPCExamples for waitforblock(height) (Sebastian Falbesoner) Pull request description: This PR fixes several broken RPCExamples from the "blockchain" category: - `HelpExampleCli` for `waitforblock` (disturbing comma between arguments) - `HelpExampleCli` for `waitforblockheight` (disturbing comma between arguments) - `HelpExampleRpc` for `waitforblockheight` (disturbing quotation marks around integer argument) Note that the CLI example for `waitforblockheight` would also work with the first argument in quotation marks (in contrast to the RPC example), but I removed them as well as they are not needed. Outputs for the non-working examples in the master branch: ``` $ ./bitcoin-cli waitforblock "0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862", 1000 error code: -8 error message: blockhash must be of length 64 (not 65, for '0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862,') ``` ``` $ ./bitcoin-cli waitforblockheight "100", 1000 error: Error parsing JSON:100, ``` ``` $ curl --user __cookie__ --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "waitforblockheight", "params": ["100", 1000]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ Enter host password for user '__cookie__': {"result":null,"error":{"code":-1,"message":"JSON value is not an integer as expected"},"id":"curltest"} ``` Outputs for the fixed examples in the PR branch: ``` $ ./bitcoin-cli waitforblock "0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862" 1000 { "hash": "0000000000000000000910ae4d56120e0ddd55c0552e80ed12dba147abc68080", "height": 622416 } ``` ``` $ ./bitcoin-cli waitforblockheight 100 1000 { "hash": "0000000000000000000910ae4d56120e0ddd55c0552e80ed12dba147abc68080", "height": 622416 } ``` ``` $ curl --user __cookie__ --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "waitforblockheight", "params": [100, 1000]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ Enter host password for user '__cookie__': {"result":{"hash":"0000000000000000000910ae4d56120e0ddd55c0552e80ed12dba147abc68080","height":622416},"error":null,"id":"curltest"} ``` ACKs for top commit: fanquake: ACK ef35604c9c88e7800e9be106b791b1c0fa8b310a Tree-SHA512: b98c6681d1aa24b3ee3ef4ef450cb630082a9f8695af18f3b6d418e5b0b1e472b787ccf6397cd719b4d5fe0082ea5f1d0ca553c1cc56066ee2d288be34c601e3
2020-03-25Merge #18134: Replace std::to_string with locale-independent alternativeWladimir J. van der Laan
d056df033a1e88554f7cc39dd709a87b17cb49df Replace std::to_string with locale-independent alternative (Ben Woosley) Pull request description: Addresses #17866 following practicalswift's suggestion: https://github.com/bitcoin/bitcoin/issues/17866#issuecomment-584287299 ~Used ::ToString to avoid aliasing issues. Left uses in QT and test.~ ACKs for top commit: practicalswift: ACK d056df033a1e88554f7cc39dd709a87b17cb49df laanwj: ACK d056df033a1e88554f7cc39dd709a87b17cb49df Tree-SHA512: 9e6966a9cdd14f4a1a40d9f0fa7c402aed22b2f1ad8681708e22b050d51a91c5d62220a9ec4c425be2d57acf5c964fca87a5e981b5cbff048bc3b6720dae92b7
2020-03-21rpc: fix broken RPCExamples for waitforblock(height)Sebastian Falbesoner
Fixes the following RPCExamples: -> ExampleCli waitforblock (removed comma between arguments) -> ExampleCli waitforblockheight (removed comma between arguments) -> ExampleRpc waitforblockheight (removed quotation marks around integer argument)
2020-03-21rpc: add missing HelpExampleRpc for getblockfilterSebastian Falbesoner
2020-03-16Merge #18346: rpc: Document an RPCResult for all calls; Enforce at compile timeWladimir J. van der Laan
fac52253f81a4f0d04b25eb4b6c28d04b85ef10b rpc: Document an RPCResult for all calls; Enforce at compile time (MarcoFalke) fadd99f61032c0b75ad9b198eb5d8e307b0518ee rpc: Add missing newline in RPCResult description (MarcoFalke) Pull request description: This documents the RPC Result (type and description, if applicable) everywhere it was missing. The patch can be reviewed with the `git diff` option `-W`/`--function-context`. Also, code won't compile without having an RPCResult documented. ACKs for top commit: laanwj: Lightly tested ACK fac52253f81a4f0d04b25eb4b6c28d04b85ef10b promag: Tested ACK fac52253f81a4f0d04b25eb4b6c28d04b85ef10b, built and verified listunspent help output. Tree-SHA512: af2c1af1432beb944993776026c320814bfaecaf202f47359f5758849096ca7051ec6560395a2cc6678dcc111e7c9cf4917d0f0b221bdcf3ed1642e14d0e5b3c
2020-03-14Replace std::to_string with locale-independent alternativeBen Woosley
2020-03-13rpc: Document an RPCResult for all calls; Enforce at compile timeMarcoFalke
2020-03-13Fix nit in getblockchaininfoSteven Roose
2020-03-13Merge #18316: util: HelpExampleRpc formattingfanquake
a33cffbeabcc42137c4a66aa19b7dd1d300e6d73 util: HelpExampleRpc formatting fixup (Jon Atack) Pull request description: Minor visual fixup of the HelpExampleRpc template; conforms to the JSON-RPC spec as per https://www.jsonrpc.org/specification#examples. (I'm... somewhat embarassed to open such a minor change, but this is what is shown in all the CLI/RPC help docs.) ACKs for top commit: laanwj: ACK a33cffbeabcc42137c4a66aa19b7dd1d300e6d73 Tree-SHA512: 8f1dee080c224742fff60a33fec6f5fb1d59c9fa51f3f2a67bf2e1837dbfa25f12a69e34518936588940013b0e61f55378b4f1a571c47c3cb081ca5b245e1091
2020-03-11Merge #18268: rpc: Remove redundant types from descriptionsMarcoFalke
8a2a652e6fab5eb8224beefcc07d9011b61865a8 Remove redundant type information from rpc docs (David O'Callaghan) Pull request description: Simple edit of the RPC calls to remove redundant text ("A json object/array ...") from the beginning of help. Fixes: #18258 Top commit has no ACKs. Tree-SHA512: cbbf760e0b7b4eda61c40b420ed77f5d878318e37b0eb13e63567212240b2c4ecc15d84030e98075e21c9ae9016539adfd201e5661ea824166a76d335180c32f
2020-03-11Merge #18208: rpc: Change RPCExamples to bech32MarcoFalke
3e32499909ca8127baaa9b40ad113b25ee151bbd Change example addresses to bech32 (Yusuf Sahin HAMZA) Pull request description: This is a follow-up PR to #18197 that fixes RPCExamples. Fixes #18185. ACKs for top commit: MarcoFalke: ACK 3e32499909ca8127baaa9b40ad113b25ee151bbd jonatack: ACK 3e32499 Tree-SHA512: c7a6410ef8b6e169016c2c5eac3e6b9501caabd0e8a0871ec31e56bfc44589f056d3f5cb55b5a13bba36f6c15136c2352f883e30e4dcc0997ffd36b27f9173b9
2020-03-11util: HelpExampleRpc formatting fixupJon Atack
to conform to json-rpc spec as per https://www.jsonrpc.org/specification#examples
2020-03-08Refactor rawtransaction's SignTransaction into generic SignTransaction functionAndrew Chow
2020-03-06scheduler: switch from boost to stdAnthony Towns
Changes from boost::chrono to std::chrono, boost::condition_var to std::condition_var, boost::mutex to sync.h Mutex, and reverselock.h to sync.h REVERSE_LOCK. Also adds threadsafety annotations to CScheduler members.
2020-03-06Merge #16117: util: Replace boost sleep with std sleepfanquake
fae86c38bca5c960462e53975314a0749db5d17d util: Remove unused MilliSleep (MarcoFalke) fa9af06d91e9357e86863781746f0e78a509967e scripted-diff: Replace MilliSleep with UninterruptibleSleep (MarcoFalke) fa4620be782c2bf6b5ffddf4f671194fdd1536f3 util: Add UnintrruptibleSleep (MarcoFalke) Pull request description: We don't use the interruptible feature of boost's sleep anywhere, so replace it with the sleep in `std::thread` ACKs for top commit: ajtowns: ACK fae86c38bca5c960462e53975314a0749db5d17d quick code review practicalswift: ACK fae86c38bca5c960462e53975314a0749db5d17d -- patch looks correct sipa: Concept and code review ACK fae86c38bca5c960462e53975314a0749db5d17d fanquake: ACK fae86c38bca5c960462e53975314a0749db5d17d - note that an instance of `DHAVE_WORKING_BOOST_SLEEP_FOR` was missed in the [linter](https://github.com/bitcoin/bitcoin/blob/master/test/lint/extended-lint-cppcheck.sh#L69), but that can be cleaned up later. Tree-SHA512: 7c0f8eb197664b9f7d9fe6c472c77d384f11c797c913afc31de4b532e3b4fd9ea6dd174f92062ff9d1ec39b25e0900ca7c597435add87f0f2477d9557204848c
2020-03-05Merge #18260: refactor: Fix implicit value conversion in formatPingTimeMarcoFalke
1891245e7318bf625bbf67aab08a79fc3e87b61d refactor: Cast ping values to double before output (Ben Woosley) 7a810b1d7a9d03818706dc94457dc3255f062796 refactor: Convert ping wait time from double to int64_t (Ben Woosley) e6fc63ec7ee637a4b533e4d7b22def05e74e1dff refactor: Convert min ping time from double to int64_t (Ben Woosley) b054c46977667953593819248c167545aa3e7a40 refactor: Convert ping time from double to int64_t (Ben Woosley) Pull request description: Alternative to #18252, see motivation there. This changes `CNodeStats` to handle ping timestamps as their original incoming usec `int64_t` values until the time they need to be displayed. ACKs for top commit: vasild: ACK 1891245 practicalswift: ACK 1891245e7318bf625bbf67aab08a79fc3e87b61d -- patch looks correct promag: ACK 1891245e7318bf625bbf67aab08a79fc3e87b61d, added cast to double and also braces. Tree-SHA512: 7cfcba941d9751b522b8c512c25da493338b444637bd0bb711b152d7d86b431ca0968956be3c844ee9dbfea25edab44a0de2afa44f2c9c0bf5b8df53eba66272
2020-03-05Merge #18263: rpc: change setmocktime check to use IsMockableChainMarcoFalke
2455aa5d7f54befeade05795ed8f5dd89d01042a [rpc] changed MineBlocksOnDemand to IsMockableChain (Gloria Zhao) Pull request description: Change: Update the if statement in `setmocktime` to use `IsMockableChain` chainparams function (aka `m_is_mockable_chain`) instead of `MineBlocksOnDemand` Rationale: It's a more appropriate check for whether or not chain is in RegTest, as [discussed](https://github.com/bitcoin/bitcoin/pull/18037#discussion_r376509388) in #18037 ACKs for top commit: MarcoFalke: ACK 2455aa5d7f54befeade05795ed8f5dd89d01042a šŸ™‡ jonatack: ACK 2455aa5d7f54befeade05795ed8f5dd89d01042a Tree-SHA512: 1d8c8b7ff0b3c1bcbf5755194969b6664fe05a35003375ad08d18e34bcefd2df4f64d0e60078a10bbef3c8f469a9b9d07db467089b55c14cf532304bc965bffc
2020-03-05[rpc] changed MineBlocksOnDemand to IsMockableChainGloria Zhao
2020-03-05Remove redundant type information from rpc docsDavid O'Callaghan
Co-Authored-By: MarcoFalke <falke.marco@gmail.com>
2020-03-05refactor: Cast ping values to double before outputBen Woosley
Note the divisor is a floating point literal so presumably also floating point.
2020-03-04refactor: Convert ping wait time from double to int64_tBen Woosley
2020-03-04refactor: Convert min ping time from double to int64_tBen Woosley
2020-03-04refactor: Convert ping time from double to int64_tBen Woosley
2020-03-04rpc: fix getpeerinfo RPCResult `mapped_as` typeJon Atack
and mention it is only available if the asmap config flag is set.
2020-03-04Merge #17809: rpc: Auto-format RPCResultMarcoFalke
fa6b061fc118995eec41766519a11bc0dd1a901d rpc: Auto-format RPCResult (MarcoFalke) fa7d0503d320900e14c4d9bc016d65c7431070bb rpc: Move OuterType enum to header (MarcoFalke) Pull request description: This enforces most syntax rules of the RPCResult at compile time (or some at run time during unit and functional tests) Apart from normalizing the syntax, by separating stylistic formatting from the structure, we could in theory directly generate the html for e.g. https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/importmulti/ ACKs for top commit: Sjors: Indeed, re-ACK fa6b061fc118995eec41766519a11bc0dd1a901d ajtowns: ACK fa6b061fc118995eec41766519a11bc0dd1a901d -- skimmed code changes and differences to rpc help output Tree-SHA512: 5b510b3aa0b7c7b9189a48c77593159409069f939145b9a00c5478e894cf65f994d44d633eb7bb7dbea40ee820645a2930976c24772379d96929002b120efa28
2020-03-01Change example addresses to bech32Yusuf Sahin HAMZA
2020-02-27Refactor FormatStateMessage into ValidationStateJeffrey Czyz
2020-02-25rpc: Auto-format RPCResultMarcoFalke
2020-02-25rpc: Move OuterType enum to headerMarcoFalke
This is needed so that it can be used by RPCResult Also, * rename NAMED_ARG to NONE for generalization. * change RPCArg constructors to initialize the members by moving values
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-21scripted-diff: Replace MilliSleep with UninterruptibleSleepMarcoFalke
This is safe because MilliSleep is never executed in a boost::thread, the only type of thread that is interruptible. * The RPC server uses std::thread * The wallet is either executed in an RPC thread or the main thread * bitcoin-cli, benchmarks and tests are only one thread (the main thread) -BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/MilliSleep\((\S+)\);/UninterruptibleSleep(std::chrono::milliseconds{\1});/g' $(git grep -l MilliSleep) -END VERIFY SCRIPT-
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-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-14Deduplicate the message signing codeVasil Dimov
The logic of signing a message was duplicated in 3 places: src/qt/signverifymessagedialog.cpp SignVerifyMessageDialog::on_signMessageButton_SM_clicked() src/rpc/misc.cpp signmessagewithprivkey() src/wallet/rpcwallet.cpp signmessage() Move the logic into src/util/message.cpp MessageSign() and call it from all the 3 places.
2020-02-14Deduplicate the message verifying codeVasil Dimov
The logic of verifying a message was duplicated in 2 places: src/qt/signverifymessagedialog.cpp SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked() src/rpc/misc.cpp verifymessage() with the only difference being the result handling. Move the logic into a dedicated src/util/message.cpp MessageVerify() which returns a set of result codes, call it from the 2 places and just handle the results differently in the callers.
2020-02-13rpc: update validateaddress RPCExamples to bech32Sebastian Falbesoner
also contains the following changes: - rpc: factor out example bech32 address for RPCExamples - doc: update developer notes wrt RPCExamples addresses (mention the EXAMPLE_ADDRESS constant as an example for an invalid bech32 address suitable for RPCExamples help documentation)
2020-02-09scripted-diff: Add missing spaces in RPCResult, Fix type namesMarcoFalke
This makes the rendered diff smaller when the RPCResult is machine generated later on -BEGIN VERIFY SCRIPT- # Add space after dictionary key and before colon sed -i --regexp-extended -e 's/(^ +" +\\"[a-zA-Z_]+\\"): ?/\1 : /g' $(git grep -l '\\":') # Rename (array) to (json array) sed -i -e 's/ (array) / (json array) /g' $(git grep -l '(array)' ./src) # Rename (object) to (json object) sed -i -e 's/ (object) / (json object) /g' $(git grep -l '(object)' ./src) # Rename (bool) to (boolean) sed -i -e 's/ (bool) / (boolean) /g' $(git grep -l '(bool)' ./src) # Rename (int) to (numeric) sed -i -e 's/ (int) / (numeric) /g' $(git grep -l '(int)' ./src) -END VERIFY SCRIPT-
2020-02-09Merge #18032: rpc: Output a descriptor in createmultisig and addmultisigaddressMarcoFalke
19a354b11f85a3c6c81ff83bf702bf7a40cf5046 Output a descriptor in createmultisig and addmultisigaddress (Andrew Chow) Pull request description: Give a descriptor from `createmultisig` and `addmultisigaddress`. Extracted from #16528 with `addmultisgaddress` and tests added. ACKs for top commit: Sjors: tACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046 MarcoFalke: ACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046 promag: Code review ACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046. meshcollider: utACK 19a354b11f85a3c6c81ff83bf702bf7a40cf5046 Tree-SHA512: e813125fbbc358ea8d45b1748de16a29a94efd83175b748fb8fa3b0bfc8e783ed36b6c554d84f5d4ead1ba252a83a3e937b6c3f75da7b8d3b4e55f94d6013771
2020-02-05Merge #17804: doc: Misc RPC help fixesWladimir J. van der Laan
fa5c6622c8ecf1954e7177888ad8c97a77b16fb7 doc: Use proper RPC help syntax in importmulti (MarcoFalke) fab63111bec73859597e6ce0986f76e5e9959091 doc: Remove duplicate "comment" from listsinceblock RPC help (MarcoFalke) fa04cd6cfc0330b62058ed169d621e08108dc87e doc: Properly document proxy_randomize_credentials as bool in getnetworkinfo (MarcoFalke) fa9dec7c395897e8dbbb6de7a16ec5185a609d41 doc: Fix syntax error (trailing square bracket) in finalizepsbt (MarcoFalke) faff5a60ed328d4c5fdef253e8935a351cb57bd0 doc: Fix syntax error (trailing square bracket) in walletprocesspsbt (MarcoFalke) fa0545901daad32b09511cc61c4af1400c48088d doc: Add missing "optional" to "long" estimaterawfee RPC help (MarcoFalke) Pull request description: This fixes documentation of the following RPCs: * estimaterawfee (hidden) * https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/walletprocesspsbt/ * https://bitcoincore.org/en/doc/0.19.0/rpc/rawtransactions/finalizepsbt/ * https://bitcoincore.org/en/doc/0.19.0/rpc/network/getnetworkinfo/ * https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/listsinceblock/ * https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/importmulti/ <!-- Also, it comes with a scripted diff to normalize whitespace and type names. (Previous attempts: #14601 and #14459) ACKs for top commit: laanwj: ACK fa5c6622c8ecf1954e7177888ad8c97a77b16fb7 Tree-SHA512: 5a10956e12f8ce23e93a2ce8bafd6cae759d8a21658f79397e3bfce3e4aabd9658bdbd40acde49323dca958a9befee7166654994208c182dd60f483109621e17
2020-01-30Output a descriptor in createmultisig and addmultisigaddressAndrew Chow
2020-01-29Merge #16702: p2p: supplying and using asmap to improve IP bucketing in addrmanWladimir J. van der Laan
3c1bc40205a3fcab606e70b0e3c13d68b2860e34 Add extra logging of asmap use and bucketing (Gleb Naumenko) e4658aa8eaf1629dd5af8cf7b9717a8e72028251 Return mapped AS in RPC call getpeerinfo (Gleb Naumenko) ec45646de9e62b3d42c85716bfeb06d8f2b507dc Integrate ASN bucketing in Addrman and add tests (Gleb Naumenko) 8feb4e4b667361bf23344149c01594abebd56fdb Add asmap utility which queries a mapping (Gleb Naumenko) Pull request description: This PR attempts to solve the problem explained in #16599. A particular attack which encouraged us to work on this issue is explained here [[Erebus Attack against Bitcoin Peer-to-Peer Network](https://erebus-attack.comp.nus.edu.sg/)] (by @muoitranduc) Instead of relying on /16 prefix to diversify the connections every node creates, we would instead rely on the (ip -> ASN) mapping, if this mapping is provided. A .map file can be created by every user independently based on a router dump, or provided along with the Bitcoin release. Currently we use the python scripts written by @sipa to create a .map file, which is no larger than 2MB (awesome!). Here I suggest adding a field to peers.dat which would represent a hash of asmap file used while serializing addrman (or 0 for /16 prefix legacy approach). In this case, every time the file is updated (or grouping method changed), all buckets will be re-computed. I believe that alternative selective re-bucketing for only updated ranges would require substantial changes. TODO: - ~~more unit tests~~ - ~~find a way to test the code without including >1 MB mapping file in the repo.~~ - find a way to check that mapping file is not corrupted (checksum?) - comments and separate tests for asmap.cpp - make python code for .map generation public - figure out asmap distribution (?) ~Interesting corner case: Iā€™m using std::hash to compute a fingerprint of asmap, and std::hash returns size_t. I guess if a user updates the OS to 64-bit, then the hash of asap will change? Does it even matter?~ ACKs for top commit: laanwj: re-ACK 3c1bc40205a3fcab606e70b0e3c13d68b2860e34 jamesob: ACK 3c1bc40205a3fcab606e70b0e3c13d68b2860e34 ([`jamesob/ackr/16702.3.naumenkogs.p2p_supplying_and_using`](https://github.com/jamesob/bitcoin/tree/ackr/16702.3.naumenkogs.p2p_supplying_and_using)) jonatack: ACK 3c1bc40205a3fcab606e70b0e3c13d68b2860e34 Tree-SHA512: e2dc6171188d5cdc2ab2c022fa49ed73a14a0acb8ae4c5ffa970172a0365942a249ad3d57e5fb134bc156a3492662c983f74bd21e78d316629dcadf71576800c
2020-01-29Merge #17156: psbt: check that various indexes and amounts are within boundsfanquake
deaa6dd144f5650b385658a0c4f9a014aff8dde2 psbt: check output index is within bounds before accessing (Andrew Chow) f1ef7f0aa46338f4cd8de79696027a1bf868f359 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Fixes #17149 Two classes of issues were found by the psbt fuzzer: values out of range and causing overflows, and prevout indexes being out of range. This PR fixes both. When accessing a specific output using the index given in the tx, check that it is actually a possible output before trying to access the output. When summing and checking amounts for `decodepsbt` and `analyzepsbt`, make sure that the values are actually valid money values.. Otherwise, stop summing and don't show the fee. For `analyzepsbt`, return that the next role is the Creator since the Creator needs to remake the transaction to be valid. ACKs for top commit: practicalswift: ACK deaa6dd144f5650b385658a0c4f9a014aff8dde2 -- only change since last ACK was the addition of tests gwillen: tested ACK deaa6dd, would also like to see this merged! Tree-SHA512: 06c36720bbb5a7ab1c29f7d15878bf9f0d3e5760c06bff479d412e1bf07bb3e0e9ab6cca820a4bfedaab71bfd7af813807e87cbcdf0af25cc3f66a53a06dbcfd