aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
AgeCommit message (Collapse)Author
2020-05-05Make InitError bilingualHennadii Stepanov
2020-05-01wallet: Remove trailing whitespace from potential translation stringsMarcoFalke
If the potential translation strings are translated in the future, trailing whitespace is going to make translation effort harder.
2020-05-01wallet: Report full error message in wallettoolMarcoFalke
2020-05-01wallet: Avoid translating RPC errors when creating txsMarcoFalke
Also, mark feebumper bilingual_str as Untranslated They are technical and have previously not been translated either. It is questionable whether they can even appear in the GUI.
2020-05-01wallet: Avoid translating RPC errors when loading walletsMarcoFalke
Common errors and warnings should be translated when displayed in the GUI, but not translated when displayed elsewhere. The wallet method CreateWalletFromFile does not know its caller, so this commit changes it to return a bilingual_str to the caller.
2020-04-30[wallet] Remove locked_chain from CWallet, its RPCs and testsAntoine Riard
This change is intended to make the bitcoin node and its rpc, network and gui interfaces more responsive while the wallet is in use. Currently because the node's cs_main mutex is always locked before the wallet's cs_wallet mutex (to prevent deadlocks), cs_main currently stays locked while the wallet does relatively slow things like creating and listing transactions. This commit only remmove chain lock tacking in wallet code, and invert lock order from cs_main, cs_wallet to cs_wallet, cs_main. must happen at once to avoid any deadlock. Previous commit were only removing Chain::Lock methods to Chain interface and enforcing they take cs_main. Remove LockChain method from CWallet and Chain::Lock interface.
2020-04-30[wallet] Move methods from Chain::Lock interface to simple ChainAntoine Riard
Remove findPruned and findFork, no more used after 17954.
2020-04-30[wallet] Move getBlockHash from Chain::Lock interface to simple ChainAntoine Riard
2020-04-30[wallet] Move getBlockHeight from Chain::Lock interface to simple ChainAntoine Riard
Add HaveChain to assert chain access for wallet-tool in LoadToWallet.
2020-04-30[wallet] Move getHeight from Chain::Lock interface to simple ChainAntoine Riard
Instead of calling getHeight, we rely on CWallet::m_last_block processed_height where it's possible.
2020-04-29Merge #18727: test: Add CreateWalletFromFile testMarcoFalke
7918c1b019a36a8f9aa55daae422c6b6723b2a39 test: Add CreateWalletFromFile test (Russell Yanofsky) Pull request description: Add unit test calling CreateWalletFromFile, which isn't currently called from other unit tests, with some basic checks to make sure it rescans and registers for notifications correctly. Motivation for this change was to try to write a test that would fail without the early `handleNotifications` call in ef8c6ca60767cac589d98ca57ee33179608ccda8 from https://github.com/bitcoin/bitcoin/pull/16426, but succeed with it: https://github.com/bitcoin/bitcoin/blob/ef8c6ca60767cac589d98ca57ee33179608ccda8/src/wallet/wallet.cpp#L3978-L3986 However, writing a full test for the race condition that call prevents isn't possible without the locking changes from #16426. So this PR just adds as much test coverage as is possible now. This new test is also useful for https://github.com/bitcoin/bitcoin/pull/15719, since it detects the stale notifications.transactionAddedToMempool notifications that PR eliminates. ACKs for top commit: MarcoFalke: ACK 7918c1b019a36a8f9aa55daae422c6b6723b2a39 jonatack: ACK 7918c1b019a36a8f9aa55daae422c6b6723b2a39 Tree-SHA512: 44035aee698ecb722c6039d061d8fac2011e9da0b314e4aff19be1d610b53cacff99016b34d6b84669bb3b61041b2318d9d8e3363658f087802ae4aa36ca17b8
2020-04-29Merge #18038: P2P: Mempool tracks locally submitted transactions to improve ↵fanquake
wallet privacy 50fc4df6c4e8a84bdda13ade7bed7a2131796f00 [mempool] Persist unbroadcast set to mempool.dat (Amiti Uttarwar) 297a1785360c4db662a7f3d3ade7b6b503258d39 [test] Integration tests for unbroadcast functionality (Amiti Uttarwar) 6851502472d3625416f0e7796e9f2a0379d14d49 [refactor/test] Extract P2PTxInvStore into test framework (Amiti Uttarwar) dc1da48dc5e5526215561311c184a8cbc345ecdc [wallet] Update the rebroadcast frequency to be ~1/day. (Amiti Uttarwar) e25e42f20a3aa39651fbc1f9fa3df1a49f1f5868 [p2p] Reattempt initial send of unbroadcast transactions (Amiti Uttarwar) 7e93eecce3bc5a1b7bb0284e06f9e2e69454f5ba [util] Add method that returns random time in milliseconds (Amiti Uttarwar) 89eeb4a3335f8e871cc3f5286af4546dff66172a [mempool] Track "unbroadcast" transactions (Amiti Uttarwar) Pull request description: This PR introduces mempool tracking of unbroadcast transactions and periodic reattempts at initial broadcast. This is a part of the rebroadcast project, and a standalone privacy win. The current rebroadcast logic is terrible for privacy because 1. only the source wallet rebroadcasts transactions and 2. it does so quite frequently. In the current system, if a user submits a transaction that does not immediately get broadcast to the network (eg. they are offline), this "rebroadcast" behavior is the safety net that can actually serve as the initial broadcast. So, keeping the attempts frequent is important for initial delivery within a reasonable timespan. This PR aims to improve # 2 by reducing the wallet rebroadcast frequency to ~1/day from ~1/15 min. It achieves this by separating the notion of initial broadcast from rebroadcasts. With these changes, the mempool tracks locally submitted transactions & periodically reattempts initial broadcast. Transactions submitted via the wallet or RPC are added to an "unbroadcast" set & are removed when a peer sends a `getdata` request, or the transaction is removed from the mempool. Every 10-15 minutes, the node reattempts an initial broadcast. This enables reducing the wallet rebroadcast frequency while ensuring the transactions will be propagated to the network. For privacy improvements around # 1, please see #16698. Thank you to gmaxwell for the idea of how to break out this subset of functionality (https://github.com/bitcoin/bitcoin/pull/16698#issuecomment-571399346) ACKs for top commit: fjahr: Code review ACK 50fc4df6c4e8a84bdda13ade7bed7a2131796f00 MarcoFalke: ACK 50fc4df6c4e8a84bdda13ade7bed7a2131796f00, I think this is ready for merge now 👻 amitiuttarwar: The current tip `50fc4df` currently has 6 ACKs on it, so I've opened #18807 to address the last bits. jnewbery: utACK 50fc4df6c4e8a84bdda13ade7bed7a2131796f00. ariard: Code Review ACK 50fc4df (minor points no need to invalid other ACKs) robot-visions: ACK 50fc4df6c4e8a84bdda13ade7bed7a2131796f00 sipa: utACK 50fc4df6c4e8a84bdda13ade7bed7a2131796f00 naumenkogs: utACK 50fc4df Tree-SHA512: 2dd935d645d5e209f8abf87bfaa3ef0e4492705ce7e89ea64279cb27ffd37f4727fa94ad62d41be331177332f8edbebf3c7f4972f8cda10dd951b80a28ab3c0f
2020-04-27Merge #18777: wallet: Recommend absolute path for dumpwalletMarcoFalke
fa501700e91b8667d4d2f116c3705e3ab9a1c8c3 wallet: Recommned absolute path for dumpwallet (MarcoFalke) Pull request description: Avoids misunderstandings such as #9564 ACKs for top commit: kristapsk: utACK fa501700e91b8667d4d2f116c3705e3ab9a1c8c3 Tree-SHA512: f675ef607992857ffeb556a2945b5436a70b39c5d83f05a8be15a6fccc84cbe9d03e52f8239e28d159e41ed7c6f119b7a38e8ab327029f04609f63c559c12c49
2020-04-26test: Add CreateWalletFromFile testRussell Yanofsky
Add unit test calling CreateWalletFromFile, which isn't currently called from other unit tests, with some basic checks to make sure it rescans and registers for notifications correctly. Motivation for this change was to try to write a test that would fail without the early `handleNotifications` call in ef8c6ca60767cac589d98ca57ee33179608ccda8 from https://github.com/bitcoin/bitcoin/pull/16426, but succeed with it: https://github.com/bitcoin/bitcoin/blob/ef8c6ca60767cac589d98ca57ee33179608ccda8/src/wallet/wallet.cpp#L3978-L3986 However, writing a full test for the race condition that call prevents isn't possible without the locking changes from #16426. So this PR just adds as much test coverage as is possible now. This new test is also useful for https://github.com/bitcoin/bitcoin/pull/15719, since it detects the stale notifications.transactionAddedToMempool notifications that PR eliminates.
2020-04-26wallet: Recommned absolute path for dumpwalletMarcoFalke
2020-04-23[wallet] Update the rebroadcast frequency to be ~1/day.Amiti Uttarwar
Since the mempool unbroadcast mechanism handles the reattempts for initial broadcast, the wallet rebroadcast attempts can be much less frequent (previously ~1/30 min)
2020-04-23Correctly check for default walletAndrew Chow
2020-04-23Implement CWallet::IsSpentKey for non-LegacySPKMansAndrew Chow
2020-04-23Return error when no ScriptPubKeyMan is available for specified typeAndrew Chow
When a CWallet doesn't have a ScriptPubKeyMan for the requested type in GetNewDestination, give a meaningful error. Also handle this in Qt which did not do anything with errors.
2020-04-23add importdescriptors RPC and tests for native descriptor walletsHugo Nguyen
Co-authored-by: Andrew Chow <achow101-github@achow101.com>
2020-04-23Add IsLegacy to CWallet so that the GUI knows whether to show watchonlyAndrew Chow
2020-04-23Generate new descriptors when encryptingAndrew Chow
2020-04-23Be able to create new wallets with DescriptorScriptPubKeyMans as backingAndrew Chow
2020-04-23Implement GetMetadata in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Change GetMetadata to use unique_ptr<CKeyMetadata>Andrew Chow
2020-04-23Implement FillPSBT in DescriptorScriptPubKeyManAndrew Chow
FillPSBT will add our own scripts to the PSBT if those inputs are ours. If an input also lists pubkeys that we happen to know the private keys for, we will sign those inputs too.
2020-04-23Implement SignMessage for descriptor walletsAndrew Chow
2020-04-23Implement SignTransaction in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement GetSolvingProvider for DescriptorScriptPubKeyManAndrew Chow
Internally, a GetSigningProvider function is introduced which allows for some private keys to be optionally included. This can be called with a script as the argument (i.e. a scriptPubKey from our wallet when we are signing) or with a pubkey. In order to know what index to expand the private keys for that pubkey, we need to also cache all of the pubkeys involved when we expand the descriptor. So SetCache and TopUp are updated to do this too.
2020-04-23Implement GetKeypoolOldestTime and only display it if greater than 0Andrew Chow
2020-04-23Implement ReturnDestination in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement GetReservedDestination in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement Unlock and Encrypt in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement GetNewDestination for DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement TopUp in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement SetupGeneration for DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement writing descriptorkeys, descriptorckeys, and descriptors to wallet ↵Andrew Chow
file
2020-04-23Implement several simple functions in DescriptorScriptPubKeyManAndrew Chow
Implements a bunch of one liners: UpgradeKeyMetadata, IsFirstRun, HavePrivateKeys, KeypoolCountExternalKeys, GetKeypoolSize, GetTimeFirstKey, CanGetAddresses, RewriteDB
2020-04-23Implement loading of keys for DescriptorScriptPubKeyManAndrew Chow
2020-04-23Load the descriptor cache from the wallet fileAndrew Chow
2020-04-23Implement GetID for DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement IsHDEnabled in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement MarkUnusedAddresses in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Implement IsMine for DescriptorScriptPubKeyManAndrew Chow
Adds a set of scriptPubKeys that DescriptorScriptPubKeyMan tracks. If the given script is in that set, it is considered ISMINE_SPENDABLE
2020-04-23Add LoadDescriptorScriptPubKeyMan and SetActiveScriptPubKeyMan to CWalletAndrew Chow
2020-04-23Implement SetType in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Store WalletDescriptor in DescriptorScriptPubKeyManAndrew Chow
2020-04-23Add a lock cs_desc_man for DescriptorScriptPubKeyManAndrew Chow
2020-04-23Introduce WalletDescriptor classAndrew Chow
WalletDescriptor is a Descriptor with other wallet metadata
2020-04-23Create LegacyScriptPubKeyMan when not a descriptor walletAndrew Chow