elements/src/wallet
Wladimir J. van der Laan 9ab9665c74
Merge #15710: wallet: Catch ios_base::failure specifically
7486e2771e Tests: Unit test related to WalletDB ReadKeyValue (Bushstar)
32def8d1c2 Catch ios_base::failure specifically (Peter Bushnell)

Pull request description:

  In https://github.com/bitcoin/bitcoin/pull/2950 a hash of the pubkey and private was added to speed up key import, this was made backwards compatible by reading the hash in a try block with an ellipses catch all in case the hash was not present.

  CDataStream::read() specifically throws std::ios_base::failure, backwards compatibility expects only that error to be thrown, if something else gets thrown we should not be catching it. The change in this commit is to catch that exception only. If any other exception is thrown other than std::ios_base::failure it will be caught by the wider try block and an error written to the log and/or console.

  CDataStream::read() throwing std::ios_base::failure.
  2c364fde42/src/streams.h (L191)

  Wider catch statements that pick up all others exceptions other than ios_base::failure.
  2c364fde42/src/wallet/walletdb.cpp (L425)

  2c364fde42/src/wallet/walletdb.cpp (L430)

ACKs for top commit:
  laanwj:
    Code review ACK 7486e2771e

Tree-SHA512: 5364bf935af8ec603bf5b8fef8c23b5cdaa4fe3506090cff988413221f2eaa99f7a91929afb42a35f8881ce2328744a0d32052da51ca0a5b2e65b6809e97f604
2020-11-19 12:32:48 +01:00
..
test Merge #15710: wallet: Catch ios_base::failure specifically 2020-11-19 12:32:48 +01:00
bdb.cpp Determine wallet file type based on file magic 2020-10-14 11:28:18 -04:00
bdb.h rpc, wallet: Expose database format in getwalletinfo 2020-10-14 21:47:42 +01:00
coincontrol.cpp [rpc] walletcreatefundedpsbt: don't automatically append inputs 2020-03-12 13:07:17 +01:00
coincontrol.h [rpc] walletcreatefundedpsbt: don't automatically append inputs 2020-03-12 13:07:17 +01:00
coinselection.cpp Refactor OutputGroups to handle effective values, fees, and filtering 2020-08-11 14:25:02 -04:00
coinselection.h Refactor OutputGroups to handle effective values, fees, and filtering 2020-08-11 14:25:02 -04:00
context.cpp Remove g_rpc_chain global 2020-05-28 02:13:19 -04:00
context.h wallet: Pass unused args to StartWallets 2020-07-09 13:07:37 +02:00
crypter.cpp
crypter.h Convert wallet to new serialization 2020-05-24 10:34:52 -07:00
db.cpp refactor: Pass wallet database into CWallet::Create 2020-09-03 12:24:32 -04:00
db.h rpc, wallet: Expose database format in getwalletinfo 2020-10-14 21:47:42 +01:00
feebumper.cpp [send] Make send RPCs return fee reason 2020-09-26 17:57:26 -07:00
feebumper.h wallet: Avoid translating RPC errors when creating txs 2020-05-01 07:39:06 -04:00
fees.cpp
fees.h
init.cpp wallet: Make -wallet setting not create wallets 2020-10-21 08:48:43 -04:00
ismine.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
load.cpp Ignoring (but warn) on duplicate -wallet parameters 2020-11-03 12:06:32 +01:00
load.h Do not create default wallet 2020-09-08 21:02:53 -04:00
rpcdump.cpp Merge #20153: wallet: do not import a descriptor with hardened derivations into a watch-only wallet 2020-11-09 20:19:00 +01:00
rpcwallet.cpp Merge #20305: wallet: introduce fee_rate sat/vB param/option 2020-11-17 13:49:12 +01:00
rpcwallet.h Assert that RPCArg names are equal to CRPCCommand ones (net, rpcwallet) 2020-09-22 20:49:30 +02:00
salvage.cpp wallet: Remove path checking code from bitcoin-wallet tool 2020-09-03 12:24:32 -04:00
salvage.h wallettool: Have RecoverDatabaseFile return errors and warnings 2020-07-26 20:22:45 -04:00
scriptpubkeyman.cpp wallet: upgrade the CHDChain version number when upgrading to split hd 2020-11-04 12:15:14 -05:00
scriptpubkeyman.h Merge #18836: wallet: upgradewallet fixes and additional tests 2020-11-16 11:03:25 +01:00
sqlite.cpp wallet: Set DatabaseStatus::SUCCESS in MakeSQLiteDatabase 2020-11-05 20:48:41 +01:00
sqlite.h rpc, wallet: Expose database format in getwalletinfo 2020-10-14 21:47:42 +01:00
wallet.cpp Merge #20305: wallet: introduce fee_rate sat/vB param/option 2020-11-17 13:49:12 +01:00
wallet.h Merge #20139: Wallet: do not return warnings from UpgradeWallet() 2020-11-17 12:43:43 +01:00
walletdb.cpp Merge #15710: wallet: Catch ios_base::failure specifically 2020-11-19 12:32:48 +01:00
walletdb.h wallet: remove db mode string 2020-10-13 18:42:59 +07:00
wallettool.cpp Show name, format and if uses descriptors in bitcoin-wallet tool 2020-10-21 13:28:15 +02:00
wallettool.h wallet: Remove path checking code from bitcoin-wallet tool 2020-09-03 12:24:32 -04:00
walletutil.cpp Merge #18836: wallet: upgradewallet fixes and additional tests 2020-11-16 11:03:25 +01:00
walletutil.h wallet: Add GetClosestWalletFeature function 2020-10-19 00:14:38 -04:00