aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcdump.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * replace asserts in RPC code with CHECK_NONFATAL and add linterAdam Jonas2019-10-301-3/+3
| |
* | Refactor: Add GetLegacyScriptPubKeyMan helperRussell Yanofsky2019-10-291-42/+30
|/ | | | | Suggested by João Barbosa <[email protected]> https://github.com/bitcoin/bitcoin/pull/17260#discussion_r339505236
* Merge #17260: Split some CWallet functions into new LegacyScriptPubKeyManMarcoFalke2019-10-291-16/+50
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f201ba59ffd2e071a36a688b80d2cff9a9c44bb2 Refactor: Split up CWallet and LegacyScriptPubKeyMan and classes (Andrew Chow) 6702048f91089d7a565e5ca5f7c8dcd2ca405a85 MOVEONLY: Move key handling code out of wallet to keyman file (Andrew Chow) ab053ec6d1e766402f88947d29cd875a285e7280 Move wallet enums to walletutil.h (Andrew Chow) Pull request description: Moves key management functions into a new class LegacyScriptPubKeyMan. First two commits are move-only commits which move stuff out of wallet.{h/cpp} and into newly created scriptpubkeyman.{h/cpp}. Third commit changes several things in CWallet to use LegacyScriptPubKeyMan. First step in the wallet boxes refactor. Note that LegacyScriptPubKeyMan and ScriptPubKeyMan cannot be used standalone yet and are still very much tied into CWallet with both accessing functions within each other. This PR is to help reduce review burden. ACKs for top commit: Sjors: Code review ACK f201ba5. promag: Code review ACK f201ba59ffd2e071a36a688b80d2cff9a9c44bb2. ryanofsky: Code review ACK f201ba59ffd2e071a36a688b80d2cff9a9c44bb2 MarcoFalke: ACK f201ba59ffd2e071a36a688b80d2cff9a9c44bb2 Tree-SHA512: bdc0d8595a06233fe003afcf968a38e0e8cc584a6a89c5bcd05309ac29dca852391802d46763ef81a108d146d0f40c79ea5438e87234ed12b4b8360c9aec94c0
| * Refactor: Split up CWallet and LegacyScriptPubKeyMan and classesAndrew Chow2019-10-251-16/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves CWallet members and methods dealing with keys to a new LegacyScriptPubKeyMan class, and updates calling code to reference the new class instead of CWallet. Most of the changes are simple text replacements and variable substitutions easily verified with: git log -p -n1 -U0 --word-diff-regex=. The only nontrivial chunk of code added is the new LegacyScriptPubKeyMan class declaration, but this code isn't new and is just selectively copied and moved from the previous CWallet class declaration. This can be verified with: git log -p -n1 --color-moved=dimmed_zebra src/wallet/scriptpubkeyman.h src/wallet/wallet.h or git diff HEAD~1:src/wallet/wallet.h HEAD:src/wallet/scriptpubkeyman.h This commit does not change behavior.
* | Rename DecodeDumpTime to ParseISO8601DateTime and move to time.cppElichai Turkel2019-10-271-15/+2
|/
* Remove unused includespracticalswift2019-10-151-1/+0
|
* Encapsulate tx status in a Confirmation structAntoine Riard2019-08-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* Give more errors for specific failure conditionsAndrew Chow2019-08-161-1/+1
| | | | | | | 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.
* Return an error from descriptor Parse that gives more information about what ↵Andrew Chow2019-08-161-2/+3
| | | | failed
* Merge #16301: Use CWallet::Import* functions in all import* RPCsMarcoFalke2019-07-261-67/+39
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 40ad2f6a58228c72c655e3061a19a63640419378 Have importwallet use ImportPrivKeys and ImportScripts (Andrew Chow) 78941da5baf6244c7c54e86cf8ce3e09ce60c239 Optionally allow ImportScripts to set script creation timestamp (Andrew Chow) 94bf156f391759420465b2ff8c44f5f150246c7f Have importaddress use ImportScripts and ImportScriptPubKeys (Andrew Chow) a00d1e5ec5eb019f8bbeb060a2b09e341d360fe5 Have importpubkey use CWallet's ImportScriptPubKeys and ImportPubKeys functions (Andrew Chow) c6a827424711333f6f66cf5f9d79e0e6884769de Have importprivkey use CWallet's ImportPrivKeys, ImportScripts, and ImportScriptPubKeys (Andrew Chow) fae7a5befd0b8746d84a6fde575e5b4ea46cb3c4 Log when an import is being skipped because we already have it (Andrew Chow) ab28e31c9563bd2cd1e4a088ffd2479517dc83f2 Change ImportScriptPubKeys' internal to apply_label (Andrew Chow) Pull request description: #15741 introduced `ImportPrivKeys`, `ImportPubKeys`, `ImportScripts`, and `ImportScriptPubKeys` in `CWallet` which are used by `importmulti`. This PR changes the remaining `import*` RPCs (`importaddress`, `importprivkey`, `importpubkey`, and `importwallet`) to use these functions as well instead of directly adding the imported items to the wallet. ACKs for top commit: MarcoFalke: ACK 40ad2f6a58228c72c655e3061a19a63640419378 (checked that behavior changes are mentioned in the commit body) ryanofsky: utACK 40ad2f6a58228c72c655e3061a19a63640419378. Only change since last review is a tweaked commit message (mentioning label update in importpubkey commit) Sjors: ACK 40ad2f6a5. Those extra tests also pass. Tree-SHA512: 910e3bbe20b6f8809a47b7293775db234125615d886c7fd99c194f4cdf00c765eb1e24b1799260f1213b98c88f9bbe696796f36087c182925e567d44e9194c98
| * Have importwallet use ImportPrivKeys and ImportScriptsAndrew Chow2019-07-241-14/+9
| | | | | | | | | | Behavior changes: * An "Importing ..." line is logged for every key, even ones that are skipped
| * Optionally allow ImportScripts to set script creation timestampAndrew Chow2019-07-241-3/+3
| | | | | | | | | | Behavior changes: * scripts imported in importmulti that are not explicilty scriptPubKeys will have timestamps set for them
| * Have importaddress use ImportScripts and ImportScriptPubKeysAndrew Chow2019-07-241-38/+14
| | | | | | | | | | | | | | | | Also removes the now unused ImportAddress and ImportScript from rpcdump.cpp Behavior changes: * No errors will be thrown when the script or key already exists in the wallet. * If the key or script is already in the wallet, their labels will be updated.
| * Have importpubkey use CWallet's ImportScriptPubKeys and ImportPubKeys functionsAndrew Chow2019-07-241-3/+8
| | | | | | | | | | Behavior changes: * If any scripts for the pubkey were already in the wallet, their timestamps will be set to 1 and label updated
| * Have importprivkey use CWallet's ImportPrivKeys, ImportScripts, and ↵Andrew Chow2019-07-181-10/+6
| | | | | | | | | | | | | | ImportScriptPubKeys Behavior changes: * If we already have the key, it's wpkh script will still be added, although it should already be there
| * Change ImportScriptPubKeys' internal to apply_labelAndrew Chow2019-07-111-1/+1
| | | | | | | | | | | | | | | | The internal bool was only to indicate whether the given label should be applied as things that are internal should not have a label. To make this clearer, we change internal to apply_label and invert its usage so things that have labels set this to true in order to have their labels applied.
* | scripted-diff: Make translation bilingualHennadii Stepanov2019-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/inline std::string _(const char\* psz)/inline bilingual_str _(const char\* psz)/' src/util/translation.h sed -i 's/return G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz;/return bilingual_str{psz, G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz};/' src/util/translation.h sed -i 's/\b_("\([^"]\|\\"\)*")/&.translated/g' $(git grep --files-with-matches '\b_("' src) echo Hard cases - multiline strings. sed -i 's/"Visit %s for further information about the software.")/&.translated/g' src/init.cpp sed -i "s/\"Only rebuild the block database if you are sure that your computer's date and time are correct\")/&.translated/g" src/init.cpp sed -i 's/" restore from a backup.")/&.translated/g' src/wallet/db.cpp sed -i 's/" or address book entries might be missing or incorrect.")/&.translated/g' src/wallet/wallet.cpp echo Special case. sed -i 's/_(COPYRIGHT_HOLDERS)/&.translated/' src/util/system.cpp test/lint/lint-format-strings.py -END VERIFY SCRIPT-
* | Refactor out translation.hHennadii Stepanov2019-07-241-2/+2
| | | | | | | | | | This is a prerequisite for introducing bilingual error messages. Note: #includes are arranged by clang-format-diff.py script.
* | rpc: switch to using RPCHelpMan.Check()Karl-Johan Alm2019-07-081-32/+10
|/
* Merge #15024: Allow specific private keys to be derived from descriptorWladimir J. van der Laan2019-06-071-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 53b7de629d3d9281dc6f8fa10e32c4cdec59c140 Add test for dumping the private key imported from descriptor (MeshCollider) 2857bc4a64cc8dc7914bc984ac878397ac64292d Extend importmulti descriptor tests (MeshCollider) 81a884bbd0dbee108d11776794d9627ca07504aa Import private keys from descriptor with importmulti if provided (MeshCollider) a4d1bd1a29be2dcc5e00c63b6b41916b1c466de0 Add private key derivation functions to descriptors (MeshCollider) Pull request description: ~This is based on #14491, review the last 3 commits only.~ Currently, descriptors have an Expand() function which returns public keys and scripts for a specific index of a ranged descriptor. But the private key for a specific index is not given. This allows private keys for specific indices to be derived. This also allows those keys to be imported through the `importmulti` RPC rather than having to provide them separately. ACKs for commit 53b7de: achow101: ACK 53b7de629d3d9281dc6f8fa10e32c4cdec59c140 Tree-SHA512: c060bc01358a1adc76d3d470fefc2bdd39c837027f452e9bc4bd2e726097e1ece4af9d5627efd942a5f8819271e15ba54f010b169b50a9435a1f0f40fd1cebf3
| * Import private keys from descriptor with importmulti if providedMeshCollider2019-06-061-2/+4
| |
* | Make reasoning about dependencies easier by not including unused dependenciespracticalswift2019-06-021-1/+0
|/
* Merge #15741: Batch write imported stuff in importmultiMeshCollider2019-05-291-46/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0db94e55d wallet: Pass WalletBatch to CWallet::UnsetWalletFlag (João Barbosa) 6cb888b37 Apply the batch treatment to CWallet::SetAddressBook via ImportScriptPubKeys (Ben Woosley) 6154a09e0 Move some of ProcessImport into CWallet::Import* (Ben Woosley) ccb26cf34 Batch writes for importmulti (Andrew Chow) d6576e349 Have WalletBatch automatically flush every 1000 updates (Andrew Chow) 366fe0be0 Add AddWatchOnlyWithDB, AddKeyOriginWithDB, AddCScriptWithDB functions (Andrew Chow) Pull request description: Instead of writing each item to the wallet database individually, do them in batches so that the import runs faster. This was tested by importing a ranged descriptor for 10,000 keys. Current master ``` $ time src/bitcoin-cli -regtest -rpcwallet=importbig importmulti '[{"desc": "sh(wpkh([73111820/44h/1h/0h]tpubDDoT2SgEjaU5rerQpfcRDWPAcwyZ5g7xxHgVAfPwidgPDKVjm89d6jJ8AQotp35Np3m6VaysfUY1C2g68wFqUmraGbzhSsMF9YBuTGxpBaW/1/*))#3w7php47", "range": [0, 10000], "timestamp": "now", "internal": true, "keypool": false, "watchonly": true}]' ... real 7m45.29s ``` This PR: ``` $ time src/bitcoin-cli -regtest -rpcwallet=importbig4 importmulti '[{"desc": "pkh([73111820/44h/1h/0h]tpubDDoT2SgEjaU5rerQpfcRDWPAcwyZ5g7xxHgVAfPwidgPDKVjm89d6jJ8AQotp35Np3m6VaysfUY1C2g68wFqUmraGbzhSsMF9YBuTGxpBaW/1/*)#v65yjgmc", "range": [0, 10000], "timestamp": "now", "internal": true, "keypool": false, "watchonly": true}]' ... real 3.93s ``` Fixes #15739 ACKs for commit 0db94e: jb55: utACK 0db94e5 ariard: Tested ACK 0db94e5 Empact: re-utACK https://github.com/bitcoin/bitcoin/pull/15741/commits/0db94e55dcbbfc741df463c404818d9033b4fff1 only change is re the privacy of `UnsetWalletFlagWithDB` and `AddCScriptWithDB`. Tree-SHA512: 3481308a64c99b6129f7bd328113dc291fe58743464628931feaebdef0e6ec770ddd5c19e4f9fbc1249a200acb04aaf62a8d914d53b0a29ac1e557576659c0cc
| * Move some of ProcessImport into CWallet::Import*Ben Woosley2019-05-281-47/+8
| | | | | | | | | | This maintains encapsulation of CWallet::database in the face of batching, e.g. allows making the `WithDB` methods private.
| * Batch writes for importmultiAndrew Chow2019-05-181-6/+7
| | | | | | | | | | | | | | | | When writing all of the imported data to the wallet, use a common WalletBatch object so that batch writes are done and the writes finish more quickly. AddKeypoolPubkey is no longer needed so it is also removed
* | Merge #16063: rpc: Mention getwalletinfo where a rescan is triggeredMarcoFalke2019-05-221-6/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be4efb165a rpc: Mention getwalletinfo where a rescan is triggered (João Barbosa) Pull request description: ACKs for commit be4efb: jonasschnelli: utACK be4efb165ab7ff5824de9a46aa06eca654b7513f sipa: utACK be4efb165ab7ff5824de9a46aa06eca654b7513f Tree-SHA512: c9e5adda6fcb71dd64ad35cc5af89b0ed815aba440df26b61ef2018abd3b801c9e93cdbedf90db3938e88dc9af39f1577c4c7248bc77260d3afda5e2a0928e68
| * | rpc: Mention getwalletinfo where a rescan is triggeredJoão Barbosa2019-05-221-6/+12
| | |
* | | RPC: Hint for importmulti in help output of importpubkey and importaddressKristaps Kaupe2019-05-221-0/+2
|/ /
* | Merge #15870: wallet: Only fail rescan when blocks have actually been prunedMarcoFalke2019-05-161-9/+21
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fa7e311e16 [doc] rpcwallet: Only fail rescan when blocks have been pruned (MarcoFalke) aaaa57c2aa scripted-diff: Bump copyright headers in wallet (MarcoFalke) faf3729242 wallet: Only fail rescan when blocks have actually been pruned (MarcoFalke) Pull request description: This brings the behaviour of the import* calls closer to importmulti. After this change, the difference between importmulti and the other import* calls is * that in importmulti you can "opt-out" of scanning early blocks by setting a later timestamp. * that in importmulti the wallet will successfully import the data, but fail to rescan. Whereas in the other calls, the wallet will abort before importing the data. ACKs for commit fa7e31: promag: utACK fa7e311e169349bfcf1dab8b980724e8ddf4e749. jnewbery: utACK fa7e311e169349bfcf1dab8b980724e8ddf4e749 Tree-SHA512: a57d52ffea94b64e0eb9b5d3a7a63031325833908297dd14eb0c5251ffea3b2113b131003f1db4e9599e014369165a57f107a7150bb65e4c791e5fe742f33cb8
| * | [doc] rpcwallet: Only fail rescan when blocks have been prunedMarcoFalke2019-05-151-1/+1
| | |
| * | scripted-diff: Bump copyright headers in walletMarcoFalke2019-05-061-1/+1
| | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./src/wallet/ -END VERIFY SCRIPT-
| * | wallet: Only fail rescan when blocks have actually been prunedMarcoFalke2019-05-061-7/+19
| |/
* | Merge #15744: refactor: Extract ParseDescriptorRangeMarcoFalke2019-05-101-6/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 510c6532ba Extract ParseDescriptorRange (Ben Woosley) Pull request description: So as to be consistently informative when the checks fail, and to protect against unintentional divergence among the checks. ACKs for commit 510c65: meshcollider: Oh apologies, yes. Thanks :) utACK https://github.com/bitcoin/bitcoin/pull/15744/commits/510c6532bae9abc5beda1c126c945923a64680cb MarcoFalke: utACK 510c6532bae9abc5beda1c126c945923a64680cb sipa: utACK 510c6532bae9abc5beda1c126c945923a64680cb Tree-SHA512: b1f0792bfaa163890a20654a0fc2c4c4a996659916bf5f4a495662436b39326692a1a0c825caafd859e48c05f5dd1865c4f7c28092be5074edda3c94f94f9f8b
| * | Extract ParseDescriptorRangeBen Woosley2019-04-131-6/+2
| | | | | | | | | | | | | | | So as to be consistently informative when the checks fail, and to protect against unintentional divergence among the checks.
* | | GetKeyBirthTimes should return key ids, not destinationsGregory Sanders2019-04-291-5/+2
| | |
* | | Replace CScriptID and CKeyID in CTxDestination with dedicated typesGregory Sanders2019-04-291-7/+7
| |/ |/|
* | Take non-importing keys into account for spendability warning in descriptor ↵Pieter Wuille2019-04-061-0/+3
| | | | | | | | import
* | Import all origin info in importmulti; even for non-importing pubkeysPieter Wuille2019-04-041-5/+4
| |
* | Keep full pubkeys in FlatSigningProvider::originsPieter Wuille2019-04-041-2/+2
|/
* wallet: Move CWallet::ReacceptWalletTransactions locks to callersJoão Barbosa2019-03-271-3/+15
|
* Remove remaining wallet accesses to node globalsRussell Yanofsky2019-03-061-7/+7
|
* Merge #15288: Remove wallet -> node global function callsMarcoFalke2019-03-041-4/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f7efd87c8f Change brace formatting (Russell Yanofsky) a1df1b48a8 Remove use of IsInitialBlockDownload in wallet code (Russell Yanofsky) 1106a6fde4 Remove use of uiInterface.LoadWallet in wallet code (Russell Yanofsky) 318f41fb2c circular-dependencies: Avoid treating some .h/.cpp files as a unit (Russell Yanofsky) d02b34c8a8 Remove use of AcceptToMemoryPool in wallet code (Russell Yanofsky) e2c8ba9f6e Remove uses of InitMessage/Warning/Error in wallet code (Russell Yanofsky) c5e59a96a8 Remove uses of GetAdjustedTime in wallet code (Russell Yanofsky) 6d6bcc77c0 Remove use of g_connman / PushInventory in wallet code (Russell Yanofsky) 00dfb2a440 Remove uses of g_connman in wallet code (Russell Yanofsky) cc3836e8f9 Remove uses of fPruneMode in wallet code (Russell Yanofsky) cc02c796d3 Remove uses of fee globals in wallet code (Russell Yanofsky) 1fb0a4a04e Remove use of CalculateMemPoolAncestors in wallet code (Russell Yanofsky) cd32160af0 Remove use of GetTransactionAncestry in wallet code (Russell Yanofsky) 291276f7f4 Remove use of GetCountWithDescendants in wallet code (Russell Yanofsky) bdc6628683 Remove use of IsRBFOptIn in wallet code (Russell Yanofsky) 80f52a2267 Remove uses of CheckFinalTx in wallet code (Russell Yanofsky) Pull request description: This change removes wallet calls to node functions that access global chain and mempool state. This is the next step in the larger #10973 refactoring change, which removes all other accesses to node global variables from wallet code. Doing this is useful to provide a better defined interface between the wallet and node, and necessary to allow wallet and node code to run in separate processes in #10102. Tree-SHA512: 40dbaf1f59fb22b32e70b054b30ba5638d638aa3240fa30e0f721d53c721cd6138a7ab4d423a24d7d2fda0b956e68d44c733abc2c9259c3d6c9fd6d4be89aa23
| * Change brace formattingRussell Yanofsky2019-02-221-4/+8
| | | | | | | | Suggested https://github.com/bitcoin/bitcoin/pull/15288#pullrequestreview-197915100
| * Remove uses of fPruneMode in wallet codeRussell Yanofsky2019-02-221-4/+4
| | | | | | | | This commit does not change behavior.
* | Use stop/[start,stop] notation in importmulti desc rangePieter Wuille2019-02-281-13/+5
|/
* [Doc] importmulti: add missing description of keypool optionDavid A. Harding2019-02-161-0/+1
|
* Make descriptor checksums mandatory in deriveaddresses and importmultiPieter Wuille2019-02-151-1/+1
|
* Import public keys in orderAndrew Chow2019-02-141-29/+37
| | | | | Do public key imports in the order that they are specified in the import or in the descriptor range.
* Add option to importmulti add an imported pubkey to the keypoolAndrew Chow2019-02-141-0/+11
| | | | | | Adds a new option to importmulti where the pubkeys specified in the import object can be added to the keypool. This only works if the wallet has private keys disabled.
* Import KeyOriginData when importing descriptorsAndrew Chow2019-02-141-1/+7
|