aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
AgeCommit message (Collapse)Author
2020-02-10Merge #18079: [0.19] psbt: check that various indexes and amounts are within ↵Wladimir J. van der Laan
bounds f5fb7fca969cd43318384bec46bb7687b1a529fd psbt: check output index is within bounds before accessing (Andrew Chow) 1cf77a2dc36c81b80a2f9af52ed99bd426061de8 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow) Pull request description: Backport of #17156, non-trivial due to crossing the refactor in #17371 ACKs for top commit: laanwj: ACK f5fb7fca969cd43318384bec46bb7687b1a529fd Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
2020-02-06psbt: check output index is within bounds before accessingAndrew Chow
Github-Pull: #17156 Rebased-From: deaa6dd144f5650b385658a0c4f9a014aff8dde2
2020-02-06wallet: Reset reused transactions cacheFabian Jahr
If a destination is reused we mark the cache of the other transactions going to that destination dirty so they are not accidentally reported as trusted when the cache is hit. Github-Pull: #17843 Rebased-From: 6fc554f591d8ea1681b8bb25aa12da8d4f023f66
2020-01-15IsUsedDestination shouldn't use key id as script id for ScriptHashGregory Sanders
Github-Pull: #17924 Rebased-From: 4b8f1e989f3b969dc628b0801d5c31ebd373719c
2020-01-14IsUsedDestination should count any known single-key addressGregory Sanders
Github-Pull: #17621 Rebased-From: 09502452bbbe21bb974f1de8cf53196373921ab9
2020-01-14Fix issue with conflicted mempool tx in listsinceblockAdam Jonas
listsinceblock now checks that returned transactions are not conflicting with any transactions that are filtered out by the given blockhash Co-Authored-By: Michael Chrostowski <michael.chrostowski@gmail.com> Github-Pull: #17258 Rebased-From: 436ad436434b94982bcb7dc1d13a21949263ef73
2020-01-14Drop signal CClientUIInterface::LoadWalletRussell Yanofsky
Github-Pull: #16963 Rebased-From: 81ea66c30e2953dee24d5b127c28daa0d9452a28
2020-01-03Fix origfee return for bumpfee with feerate argGregory Sanders
Github-Pull: #17643 Rebased-From: 02afb0c550dc8529918460c845d1da3adf236eed
2019-10-02Merge #16727: wallet: Explicit feerate for bumpfeeWladimir J. van der Laan
c812aba3949b6ab81030dc708cda7c8821be2f70 test bumpfee fee_rate argument (ezegom) 9f25de3d9eb8d012ca1a98cbcd28021e3e1c85ee rpc bumpfee check fee_rate argument (ezegom) 88e5f997dfab3f03bb1ec3f149eaff8dcc2981fe rpc bumpfee: add fee_rate argument (ezegom) 1a4c791cf49ff15aa9deba4388c0180b8f47f15b rpc bumpfee: move feerate estimation logic into separate method (ezegom) Pull request description: Taking over for https://github.com/bitcoin/bitcoin/pull/16492 which seems to have gone inactive. Only minor commit cleanups, rebase, and some help text fixes on top of previous PR. Renamed `feeRate` to `fee_rate` to reflect updated guidelines. ACKs for top commit: Sjors: Code review ACK c812aba laanwj: ACK c812aba3949b6ab81030dc708cda7c8821be2f70 Tree-SHA512: 5f7f51bd780a573ccef1ccd72b0faf3e5d143f6551060a667560c5163f7d9480e17e73775d1d7bcac0463f3b6b4328f0cff7b27e39483bddc42a530f4583ce30
2019-10-02Merge #16952: gui: make sure to update the UI when deleting a transactionWladimir J. van der Laan
addaf8af8268d918973883a304025d40af5a33c1 make sure to update the UI when deleting a transaction (Jonas Schnelli) Pull request description: `CWallet::ZapSelectTx` removes transactions from the internal model, but leaves the UI in the dark. Adding a `NotifyTransactionChanged()` should avoid having invalid transactions in the GUI. Fixes #16950 ACKs for top commit: fanquake: ACK addaf8af8268d918973883a304025d40af5a33c1 - tested that this fixes #16950 Sjors: tACK addaf8a: tested with an unpruned wallet by calling `removeprunedfunds` on an RBF-replaced transaction. It neatly disappears from the UI. kristapsk: ACK addaf8af8268d918973883a304025d40af5a33c1 (tested both with and without this change) Tree-SHA512: 65e8c690847f7499e82c9fef67b60d9aaa63c853732fe7fa7281da33054fcdcd9d24f5b86de71b0827728c25bac8efb7db445863f990304ebfee6fc450620c47
2019-09-30Merge #16397: doc: Clarify includeWatching for fundrawtransactionWladimir J. van der Laan
80031045fc6435ef4eb5dd1aee773d938c57a0fd Clarify includeWatching for fundrawtransaction (Steven Roose) Pull request description: Might be sufficient to solve https://github.com/bitcoin/bitcoin/issues/16396, https://github.com/bitcoin/bitcoin/issues/7879 and https://github.com/bitcoin/bitcoin/issues/14405. ACKs for top commit: Sjors: ACK 8003104. This will always be confusing, but at least it gives a bunch more clues for the user to google. Tree-SHA512: 9b8002c259c50f93d89fc5574105aae6152858d8d45c07b4c3d5b7023adafe73c7a98a290874ff3fbbb7dfad2ac1bdf4acb8769a2a1c14e38484922f44e84e54
2019-09-28rpc bumpfee check fee_rate argumentezegom
2019-09-28rpc bumpfee: add fee_rate argumentezegom
2019-09-24make sure to update the UI when deleting a transactionJonas Schnelli
2019-09-14rpc: fix regression in gettransactionJon Atack
PR 16866 renamed the 'decode' argument in gettransaction to 'verbose' to make it more consistent with other RPC calls like getrawtransaction. However, it seems it inadvertently overloaded the 'details' fields when 'verbose' is passed. The result is that the original 'details' fields are no longer returned, which seems to be a breaking API change. This PR takes the simplest path to restoring the 'details' fields by renaming them from 'details' back to 'decoded', while leaving the 'verbose' argument for API consistency. It also addresses [this comment](https://github.com/bitcoin/bitcoin/pull/16185#discussion_r320740413) to mention that the 'decoded' field is identical to decoderawtransaction. Update the RPC help, functional test, and release note.
2019-09-13[wallet] Rename 'decode' argument in gettransaction method to 'verbose'John Newbery
This makes the RPC method consistent with other RPC methods that have a 'verbose' option. Change the name of the return object from 'decoded' to details. Update help text.
2019-09-13Clarify includeWatching for fundrawtransactionSteven Roose
2019-09-09Merge #16796: wallet: Fix segfault in CreateWalletFromFileSamuel Dobson
fa734603b78ba31ebf0da5d2dbe87386eafff01a wallet: Fix segmentation fault in CreateWalletFromFile (MarcoFalke) fab3c34412379598b812631e3c123e9467cdc485 test: Print both messages on failure in assert_raises_message (MarcoFalke) faa13539d5262bb7a512e9ff82e80083e04315ee wallet: Fix documentation around WalletParameterInteraction (MarcoFalke) Pull request description: Comes with a test to aid review. The test should fail without the fix to bitcoind The following `CreateWalletFromFile` issues are fixed: * `walletFile` refers to freed memory and will thus corrupt the debug.log and/or crash the node if read * `WalletParameterInteraction` was moved to `CreateWalletFromFile` and `WalletInit::ParameterInteraction` without updating the documentation ACKs for top commit: promag: ACK fa734603b78ba31ebf0da5d2dbe87386eafff01a. darosior: ACK fa734603b78ba31ebf0da5d2dbe87386eafff01a meshcollider: LGTM, code-read ACK fa734603b78ba31ebf0da5d2dbe87386eafff01a Tree-SHA512: 2aceb63a3f25b90a840cfa08d37f5874aad4eb3df8c2ebf94e2ed18b55809b185e6920bdb345b988bff1fcea5e68a214fe06c361f7da2c01a3cc29e0cc421cb4
2019-09-07Merge #16798: Refactor rawtransaction_util's SignTransaction to separate ↵fanquake
prevtx parsing 39034f1ee628dae0bc9da5b1b30b8a424e66d968 Refactor rawtransaction_util's SignTransaction to have previous tx parsing be separate (Andrew Chow) Pull request description: Currently the `SignTransaction` function has to handle both the actual signing and parsing of previous transaction data. This PR splits it so that `SignTransaction` only handles the signing itself and adds a `ParsePrevouts` function which handles parsing the prevtx information. This allows for `SignTransaction` to just take any `SigningProvider`. Split from #16341 ACKs for top commit: MarcoFalke: ACK 39034f1ee628dae0bc9da5b1b30b8a424e66d968 instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/16798/commits/39034f1ee628dae0bc9da5b1b30b8a424e66d968 ryanofsky: utACK 39034f1ee628dae0bc9da5b1b30b8a424e66d968. No change since previously reviewed b49bbb939be92a67ff77c3f7bca5bb94dd141906, https://github.com/bitcoin/bitcoin/pull/16341#pullrequestreview-278610269 other than rebase with no conflicts. Tree-SHA512: 09f7733e90691766bfb5cf0f20e913dbf270bd3b51abdcad966b24d110e562ed85fd3d0d1d7bbea61f903340060052ec73c4817b09aee0dc1f3916d781a9e40c
2019-09-06Merge #16624: wallet: encapsulate transactions stateMeshCollider
442a87cc0ae43ebc9b6654a6165778eecb931f74 Add a test wallet_reorgsrestore (Antoine Riard) 40ede992d97df38282919693dfe851c975c3b1d8 Modify wallet tx status if has been reorged out (Antoine Riard) 7e89994133725125dddbfa8d45484e3b9ed51c6e Remove SyncTransaction for conflicted txn in CWallet::BlockConnected (Antoine Riard) a31be09bfd77eed497a8e251d31358e16e2f2eb1 Encapsulate tx status in a Confirmation struct (Antoine Riard) Pull request description: While working on #15931, I've tried to rationalize tx state management to ease integration of block height tracking per-wallet tx. We currently rely on a combination of `hashBlock` and `nIndex` with magic value to determine tx confirmation, conflicted or abandoned state. It's hard to reason and error-prone. To solve that, we encapsulate these fields in a `TxConfirmation` struct and introduce a `TxState` member that we update accordingly at block connection/disconnection. Following jnewbery [recommendation](https://github.com/bitcoin/bitcoin/pull/15931#discussion_r312576506), I've taken these changes in its own commit, and open a PR to get them first. It would ease review of aforementioned PR, but above all should ease fixing of long-term issues like : * https://github.com/bitcoin/bitcoin/issues/7315 (but maybe we should abandon abandontransaction or relieve it to only free outpoints not track the transaction as abandoned in itself, need its own discussion) * https://github.com/bitcoin/bitcoin/issues/8692 where we should cancel conflicted state of transactions chain smoothly * `MarkConflicted` in `LoadToWallet` is likely useless if we track conflicts rights at block connection Main changes of this PR to get right are tx update in `AddToWallet` and serialization/deserialization logic. ACKs for top commit: meshcollider: Light re-Code Review ACK 442a87cc0ae43ebc9b6654a6165778eecb931f74 ryanofsky: utACK 442a87cc0ae43ebc9b6654a6165778eecb931f74. Changes since last review are switching from `hasChain` to `LockChain` and removing chain lock in `WalletBatch::LoadWallet` that's redundant with the new lock still added in `CWallet::LoadWallet`, and fixing python test race condition. Tree-SHA512: 029209e006de0240436817204e69e548c5665e2b0721b214510e7aba7eba130a5eab441d3a1ad95bd6426114dd27390492c77bf4560a9610009b32cd0a1f72f7
2019-09-03Refactor rawtransaction_util's SignTransaction to have previous tx parsing ↵Andrew Chow
be separate
2019-09-03wallet: Fix segmentation fault in CreateWalletFromFileMarcoFalke
2019-09-03wallet: Fix documentation around WalletParameterInteractionMarcoFalke
2019-09-03Merge #16745: wallet: Translate all initErrors in CreateWalletFromFileWladimir J. van der Laan
fa61365a1368f9970fa22fb96f89f4ecc08e69f0 wallet: Translate all initErrors in CreateWalletFromFile (MarcoFalke) fa70d199d0c2182d76b2a1cfa21f9ada4bb12913 util: Make util/error bilingual_str (refactor) (MarcoFalke) Pull request description: The translations are going to close in three days (#15940), so I am submitting this as a standalone pull request. Those changes are part of a bugfix #16661, which includes a test. The first change (the refactor) is required, the second commit is not. I am happy to drop it, if needed. ACKs for top commit: laanwj: utACK fa61365a1368f9970fa22fb96f89f4ecc08e69f0 hebasto: ACK fa61365a1368f9970fa22fb96f89f4ecc08e69f0, I have tested the code on Linux Mint 19.2. Tree-SHA512: a7616cc38b9ffd301c6b915ea808a65815c3d97e9f57ec091772eb260e5cf0d75a13a6e4dfa3913e236833677c7929b9a748cb7d7a0e406d51749944b614e11b
2019-09-02Merge #16185: gettransaction: add an argument to decode the transactionMeshCollider
9965940e35c445ccded55510348af228ff22f0e9 doc: Add release note for the new gettransaction argument (darosior) b8b3f0435a2837d3897e9e232ef6ca839ce74eb8 tests: Add a new functional test for gettransaction (darosior) 7f3bb247a811582d1aa4805d8e601c19808dc7ba gettransaction: add an argument to decode the transaction (darosior) Pull request description: This PR adds a new parameter to the `gettransaction` call : `decode`. If set to `true`, it will add a new `decoded` field to the response. This mimics the behavior of `getrawtransaction`'s `verbose` argument to avoid using 2 calls if we want to decode a wallet transaction (`gettransaction` then `decoderawtransaction`). Fix #16181 . ACKs for top commit: meshcollider: re-utACK 9965940e35c445ccded55510348af228ff22f0e9 Tree-SHA512: bcb6b4bd252b3488d6afc77659c499c2ad99fd58661eb24b6a2e17014c74f22e47fde70e00fedb4f4754915786622ad02483b2cf2c4dea0ab0eb4ac8276dbeee
2019-08-31Merge #16716: wallet: Use wallet name instead of pointer on unload/releasefanquake
d9d8984270dbb004ec94f8dbb289be2bc9e4dbc3 wallet: Use wallet name instead of pointer on unload/release (João Barbosa) Pull request description: Fixes #16668. Wallet name is unique so it can be used instead of pointer. ACKs for top commit: meshcollider: utACK d9d8984270dbb004ec94f8dbb289be2bc9e4dbc3 instagibbs: utACK https://github.com/bitcoin/bitcoin/pull/16716/commits/d9d8984270dbb004ec94f8dbb289be2bc9e4dbc3 ryanofsky: utACK d9d8984270dbb004ec94f8dbb289be2bc9e4dbc3. Alternately I think it might be possible to use an intptr_t set instead of a string set to get around the undefined behavior described in the issue. Tree-SHA512: eccd4d260cd4c02b52c30deeb32dbfd190a1151a5340eb3aa4ece0dc6ae3b3ed746ce5617336461f6f27c437c435629cd07d20beb1c5450f23b75edde6728598
2019-08-30gettransaction: add an argument to decode the transactiondarosior
This adds a new boolean parameter 'decode' to the gettransaction call, which, if set to true, add a 'decoded' field to the result containing the decoded transaction
2019-08-29Modify wallet tx status if has been reorged outAntoine Riard
Add a LockChain method to CWallet to know if we can lock or query chain state safely. At tx loading, we rely on chain to know if hashBlock of tx is still in main chain. If not, we set its status to unconfirmed and reset its hashBlock/nIndex. If wallet loaded is the wallet-tool one, all wallet txn will show up with a height of zero. It doesn't matter as status is not used by wallet-tool. We take lock prematurely in CWallet::LoadWallet and CWallet::Verify to ensure that lock order is respected between cs_main an cs_wallet.
2019-08-29wallet: extract PubKey from P2PK script with SolverSebastian Falbesoner
The function ExtractPubKey() checks if a given script matches the P2PK pattern (<PubKey> OP_CHECKSIG), extracts the PubKey and additionally checks if it is cryptographically valid (full validation with ECC library via .IsFullyValid()). Currently this is done manually in the following order: 1) check if first script OP is data push with valid PubKey length (first part of pattern match), extract PubKey 2) create CPubKey object with extracted PubKey 3) fully validate public key 4) check if last script OP is OP_CHECKSIG (second part of pattern match) Using Solver, the pattern matching and PubKey extraction can be done via a single step, leading to the following simplified order with shorter code: 1) check if given script matches P2PK pattern with Solver (also contains valid PubKey length check), extracts Pubkey 2) create CPubKey object with extracted Pubkey 3) fully validate public key
2019-08-28wallet: Translate all initErrors in CreateWalletFromFileMarcoFalke
Every warning or error in this method is translated, except for those two. Translate them as well for consistency.
2019-08-28util: Make util/error bilingual_str (refactor)MarcoFalke
Translated strings should not end up in the debug log, stderr, or returned by an RPC. Changing the util methods in util/error to return a bilingual_str paves the way to achieve this goal in the long term.
2019-08-26rpc bumpfee: move feerate estimation logic into separate methodezegom
2019-08-25wallet: Use wallet name instead of pointer on unload/releaseJoão Barbosa
2019-08-23Remove SyncTransaction for conflicted txn in CWallet::BlockConnectedAntoine Riard
We shouldn't rely on this sync call to get an accurate view of txn state, if a tx conflicts with one in mapTx we are going to update our wallet dependencies in AddToWalletIfInvolvingMe while conflicting txn get connected. If it doesn't conflict with one of our dependencies we are not going to track it anyway. This is a cleanup, as this SyncTransaction is redundant with the following one for confirmation which is triggering the MarkConflicted logic. We keep the loop because set of conflicted txn isn't same as txn included in block.
2019-08-23Encapsulate tx status in a Confirmation structAntoine Riard
Instead of relying on combination of hashBlock and nIndex values to manage tx in its lifecycle, we introduce 4 status : CONFIRMED, UNCONFIRMED, CONFLICTED, ABANDONED. hashBlock and nIndex magic values should only be used at serialization/deserialization for backward-compatibility. At block disconnection, we know flag txn as UNCONFIRMED where previously they kept their states until being override by a block connection or abandontransaction call. This is a change in behavior for which user may have to call abandon twice if transaction is disconnected and not accepted back in the mempool. We assert status transitioning right in AddToWallet. Doing so flagged a misbehavior in ComputeTimeSmart unit test where same tx is confirmed twice in different block. To avoid inconsistencies we unconfirmed tx before new connection in different block. We also remove a cs_main lock in test, as AddToWallet and its callees don't rely on locked chain.
2019-08-21Merge #16572: wallet: Fix Char as Bool in Walletfanquake
2dbfb37b407ed23b517f507d78fb77334142dce5 Fix Char as Bool in interfaces (Jeremy Rubin) Pull request description: In a few places in src/wallet/wallet.h, we use a char when semantically we want a bool. This is kind of an issue because it means we can unserialize the same transaction with different fFromMe flags (as differing chars) and evaluate the following section in wallet/wallet.cpp ```c++ if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe) { wtx.fFromMe = wtxIn.fFromMe; fUpdated = true; } ``` incorrectly (triggering an fUpdated where both fFromMe values represent true, via different chars). I don't think this is a vulnerability, but it's just a little messy and unsemantic, and could lead to issues with stored wtxIns not being findable in a map by their hash. The serialize/unserialize code for bool internally uses a char, so it should be safe to make this substitution. NOTE: Technically, this is a behavior change -- I haven't checked too closely that nowhere is depending on storing information in this char. Theoretically, this could break something because after this change a tx unserialized with such a char would preserve it's value, but now it is converted to a ~true~ canonical bool. ACKs for top commit: achow101: Code review ACK 2dbfb37b407ed23b517f507d78fb77334142dce5 meshcollider: Code review ACK 2dbfb37b407ed23b517f507d78fb77334142dce5 Tree-SHA512: 8c0dc9cf672aa2276c694facbf50febe7456eaa8bf2bd2504f81a61052264b8b30cdb5326e1936893adc3d33504667aee3c7e207a194c71d87b3e7b5fe199c9d
2019-08-16Give more errors for specific failure conditionsAndrew Chow
Some failure conditions implicitly fail by failing some other check. But the error messages are more helpful if they say explicitly what actually caused the failure, so add those as failure conditions and errors.
2019-08-16Return an error from descriptor Parse that gives more information about what ↵Andrew Chow
failed
2019-08-16Merge #16383: rpcwallet: default include_watchonly to true for watchonly walletsfanquake
72eaab073bc747425fe551777154b13a6c4c37c9 tests: functional watch-only wallet tests (William Casarin) 72ffbdc5799c1707ecad674d701b43fb80b031d0 doc: add release note for include_watchonly default changes (William Casarin) 003a3c73c0450aa18ac2ab2ca47def2b8c53a7df rpcwallet: document include_watchonly default for watchonly wallets (William Casarin) a50d9e6c0b8e8144d3deec58ec2e3449ba081151 rpcwallet: default include_watchonly to true for watchonly wallets (William Casarin) Pull request description: Right now it's a bit annoying to deal with watchonly wallets, many rpc commands have an `include_watchonly` argument that needs to be explicitly set. Wallets created with `createwallet` can have a `disable_private_keys` parameter, for those wallets we already know that they are watchonly, so there's no reason to have to explicitly ask for it for every command. Instead we check this wallet flag when the `include_watchonly` parameter isn't set. ACKs for top commit: achow101: Code review ACK 72eaab073bc747425fe551777154b13a6c4c37c9 Sjors: ACK 72eaab073bc747425fe551777154b13a6c4c37c9 promag: ACK 72eaab073bc747425fe551777154b13a6c4c37c9, code review only, didn't look closely to the test. kallewoof: ACK 72eaab073bc747425fe551777154b13a6c4c37c9 fanquake: ACK 72eaab073bc747425fe551777154b13a6c4c37c9 - I've looked over the changes, they make sense to me. Compiled and ran the tests etc. Tree-SHA512: d3646b55e97f386594d7efc994f0712f3888475c6a5dc7f131ac9f8c49bf5d4677182b88f42b34152abe1ad101ecadd152b4c20e9d3c1267190db36f77ab8bd7
2019-08-12Merge #16557: [wallet] restore coinbase and confirmed/conflicted checks in ↵MarcoFalke
SubmitMemoryPoolAndRelay() c8b53c3beafa289dcdbd8c2ee9f957bdeca79cbc [wallet] Restore confirmed/conflicted tx check in SubmitMemoryPoolAndRelay() (John Newbery) 214c4ecb9ab306627a08abb35cf82c73f10ec627 [wallet] restore coinbase check in SubmitMemoryPoolAndRelay() (John Newbery) Pull request description: These checks don't change mempool acceptance/relay behaviour, but reduce log spam. ACKs for top commit: MarcoFalke: ACK c8b53c3beafa289dcdbd8c2ee9f957bdeca79cbc (non-doc changes are mostly a git revert 8753f5652b4710e66b50ce87788bf6f33619b75a) ariard: utACK c8b53c3 Tree-SHA512: f928573ad68d2f70ac69a84b57f352d255dccd1942097cc664f130fcbdcdd7364bc52c43b9157e65ebbaaebbe93586c6e8386f24361b27478e0a23a445677672
2019-08-09[wallet] Restore confirmed/conflicted tx check in SubmitMemoryPoolAndRelay()John Newbery
Restores the confirmed/conflicted tx check removed in 8753f5652b4710e66b50ce87788bf6f33619b75a. There should be no external behaviour change (these txs would not get accepted to the mempool anyway), but not having the check in the wallet causes log spam. Also adds a comment to ResentWalletTransactions() that confirmed/conflicted tx check is done in SubmitMemoryPoolAndRelay().
2019-08-08Remove p2pEnabled from Chain interfaceAntoine Riard
RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped.
2019-08-08Fix Char as Bool in interfacesJeremy Rubin
2019-08-06[wallet] restore coinbase check in SubmitMemoryPoolAndRelay()John Newbery
This check doesn't change mempool acceptance/relay behaviour, but reduces log spam.
2019-08-02Merge #16097: Refactor: Add Flags enum to ArgsManager classMarcoFalke
e6f649cb2c07bf55d9214c2876619c56f1d6fe30 test: Make tests arg type specific (Hennadii Stepanov) b70cc5d73357ea11296f3b6bb81193ba1101e73b Revamp option negating policy (Hennadii Stepanov) db08edb3038a085d3dbce7bb4ec3c1d9b9a5b281 Replace IsArgKnown() with FlagsOfKnownArg() (Hennadii Stepanov) dde80c272ae584410532f48d23866d7d8581a1cc Use ArgsManager::NETWORK_ONLY flag (Hennadii Stepanov) 9a12733508e47f558959f1b0ed9937bc3eff8962 Remove unused m_debug_only member from Arg struct (Hennadii Stepanov) fb4b9f9e3b433d8848832e2c2686cf7b1f212a5e scripted-diff: Use ArgsManager::DEBUG_ONLY flag (Hennadii Stepanov) 1b4b9422cad28d1bead24ff5fd472536954cfaf9 scripted-diff: Use Flags enum in AddArg() (Hennadii Stepanov) 265c1b58d89b7b6fb30468ba402d7f75cc59a510 Add Flags enum to ArgsManager (Hennadii Stepanov) e0d187dfeb18b026de22bd7960b2a50c2b958e1a Refactor InterpretNegatedOption() function (Hennadii Stepanov) e0e18a1017fa3dc5d6ebeda6ec35c4263327d17c refactoring: Check IsArgKnown() early (Hennadii Stepanov) Pull request description: This PR adds the `Flags` enum to the `ArgsManager` class. Also the `m_flags` member is added to the `Arg` struct. Flags denote an allowed type of an arg value and special hints. This PR is only a refactoring and does not change behavior. ACKs for top commit: jamesob: ACK https://github.com/bitcoin/bitcoin/pull/16097/commits/e6f649cb2c07bf55d9214c2876619c56f1d6fe30 MarcoFalke: ACK e6f649cb2c07bf55d9214c2876619c56f1d6fe30 thanks for adding types to the command line options Tree-SHA512: b867f8a9cbce2d2473c293d534af662d8cd5be15060ff0682e97af678974bdaac35e8bc6328ccba32f105034bcd38f169b92a6fb67798667891ce14d5d2a2dea
2019-08-02Merge #15713: refactor: Replace chain relayTransactions/submitMemoryPool by ↵MarcoFalke
higher method fb62f128bbfd8c6cd72ea8e23331a4bae23883ab Tidy up BroadcastTransaction() (John Newbery) b8eecf8e79dad92ff07b851b1b29c2a66546bbc1 Remove unused submitToMemoryPool and relayTransactions Chain interfaces (Antoine Riard) 8753f5652b4710e66b50ce87788bf6f33619b75a Remove duplicate checks in SubmitMemoryPoolAndRelay (Antoine Riard) 611291c198eb2be9bf1aea1bf9b2187b18bdb3aa Introduce CWalletTx::SubmitMemoryPoolAndRelay (Antoine Riard) 8c8aa19b4b4fa56cd359092ef099bcfc7b26c334 Add BroadcastTransaction utility usage in Chain interface (Antoine Riard) Pull request description: Remove CWalletTx::AcceptToMemoryPool Replace CWalletTx::RelayWalletTransaction by SubmitMemoryPoolAndRelay Add a relay flag to broadcastTransaction because wasn't sure of ReacceptWalletTransactions semantic. Obviously, working on implementing https://github.com/bitcoin/bitcoin/pull/14978#issuecomment-459373984 to add the new higher-method in Node interface, will add a commit, just need more thought to do it cleanly ACKs for top commit: MarcoFalke: re-ACK fb62f128bbfd8c6cd72ea8e23331a4bae23883ab Sjors: re-ACK fb62f128bbfd8c6cd72ea8e23331a4bae23883ab Tree-SHA512: a7ee48b0545f537fa65cac8ed4cb24e777ab90b877d4eefb87971fa93c6a59bd555b62ad8940c6ffb40592a0bd50787d27587af99f20b56af72b415b6394251f
2019-08-02Merge #15911: Use wallet RBF default for walletcreatefundedpsbtMarcoFalke
d6b3640ac732f6f66a8cb6761084d1beecc8a876 [test] walletcreatefundedpsbt: check RBF is disabled when -walletrbf=0 (Sjors Provoost) 9ed062b5685eb6227d694572cb0f7bfbcc151b36 [doc] rpc: remove "fallback to" from RBF default help (Sjors Provoost) 4fcb698bc2bb74171cd3a14b94f9882d8e19e9fb [rpc] walletcreatefundedpsbt: use wallet default RBF (Sjors Provoost) Pull request description: The `walletcreatefundedpsbt` RPC call currently ignores `-walletrbf` and defaults to not use RBF. This PR fixes that. This PR also replaces UniValue in `ConstructTransaction` with a `bool` in preparation of moving this helper method out of the RPC codebase entirely. This may be a bit overkill, but does slightly simplify it. Fixes #15878 ACKs for top commit: achow101: Code Review ACK d6b3640ac732f6f66a8cb6761084d1beecc8a876 l2a5b1: re-ACK d6b3640 MarcoFalke: ACK d6b3640ac732f6f66a8cb6761084d1beecc8a876 Tree-SHA512: 55b9bccd1ef36b54f6b34793017dc0721103099ad3761b3b04862291ee13d6915915d4dbb1a8567924fa56e5e95dfe10eec070e06701610e70c87f8ea92b2a00
2019-08-01Remove duplicate checks in SubmitMemoryPoolAndRelayAntoine Riard
IsCoinBase check is already performed early by AcceptToMemoryPoolWorker GetDepthInMainChain check is already perfomed by BroadcastTransaction To avoid deadlock we MUST keep lock order in ResendWalletTransactions and CommitTransaction, even if we lock cs_main again further. in BroadcastTransaction. Lock order will need to be clean at once in a future refactoring
2019-08-01Introduce CWalletTx::SubmitMemoryPoolAndRelayAntoine Riard
Higher wallet-tx method combining RelayWalletTransactions and AcceptToMemoryPool, using new Chain::broadcastTransaction
2019-08-01Merge #16277: [Tests] Suppress output in test_bitcoin for expected errorsWladimir J. van der Laan
7a0c2242890549b6dddac4cc6f1840a528469f2a Suppress output in test_bitcoin for expected errors (Gert-Jaap Glasbergen) Pull request description: Closes #15944 This adds two methods to noui, that allows temporarily suppressing (and then resuming) the output from `noui`. For situations where errors are expected, it's confusing for the test binary to output an error and then conclude with `No errors detected`. It also uses this supress/reconnect in the tests that currently produce verbose errors when running `test_bitcoin`. Output of `test_bitcoin` on current master: ``` gertjaap@gjdesktop:~/src/bitcoin$ src/test/test_bitcoin Running 351 test cases... Error: Specified -walletdir "/tmp/test_common_Bitcoin Core/1561389554_943311758/tempdir/path_does_not_exist" does not exist Error: Specified -walletdir "/tmp/test_common_Bitcoin Core/1561389554_643733972/tempdir/not_a_directory.dat" is not a directory Error: Specified -walletdir "wallets" is a relative path *** No errors detected ``` Output after this code is merged: ``` gertjaap@gjdesktop:~/src/bitcoin$ src/test/test_bitcoin Running 351 test cases... *** No errors detected ``` ACKs for top commit: l2a5b1: ACK 7a0c224 - tested and reviewed. laanwj: ACK 7a0c2242890549b6dddac4cc6f1840a528469f2a Tree-SHA512: c7881f7a431a065329360ffa9937ce4742694c646c90c019d3aff95dfd7fccbdcda9116c5762feb6dfd1108d14f9fb386e203b173c4bde9093afb2b8c977d13d