bitcoin/src/wallet
fanquake c0b1706964
Merge #19568: Wallet should not override signing errors
e7448d6680 wallet: Don't override signing errors (Fabian Jahr)

Pull request description:

  While reviewing #17204 I noticed that the errors in `input_errors` from `::SignTransaction` where being overridden by `CWallet::SignTransaction`. For example, a Script related error led to incomplete signature data which led to `CWallet::SignTransaction` reporting that keys were missing, which was a less precise error than the original one.

  Additionally, the error `"Input not found or already spent"` is [duplicated in `sign.cpp`](c7b4968552/src/script/sign.cpp (L481)), so the error here is redundant at the moment. So technically the whole error block could be removed, I think. However, this code is affected by the ongoing work on the wallet so there might be a reason why these errors are here. But even if there is a reason to keep them, I don't think existing, potentially more precise errors should be overridden here unless we want to hide them from the users. I am looking for feedback if this is a work in progress state where these errors could be more useful in the future or if they can be removed.

  On testing: even though [the errors in `CWallet` are covered](https://marcofalke.github.io/btc_cov/total.coverage/src/wallet/wallet.cpp.gcov.html), all tests still pass after removing them. I am not sure if there is a desire to cover these specific error messages, tests in `test/functional/rpc_signrawtransaction.py` seem to aim for a more generic approach.

ACKs for top commit:
  achow101:
    ACK e7448d6680
  meshcollider:
    Code review ACK e7448d6680

Tree-SHA512: 3e2bc11d05379d2aef87b093a383d1b044787efc70e35955b2f8ecd028b6acef02f386180566af6a1a63193635f5d685466e2f6141c96326c49ffc5c81ca3e23
2020-08-14 16:04:31 +08:00
..
test Make Hash[160] consume range-like objects 2020-07-30 13:57:54 -07:00
bdb.cpp refactor: Make HexStr take a span 2020-08-06 19:41:43 +02:00
bdb.h Remove BDB dummy databases 2020-07-29 12:30:23 -04: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 bnb: exit selection when best_waste is 0 2020-03-04 16:35:15 -05:00
coinselection.h amount: Move CAmount CENT to unit test header 2018-09-17 14:34:56 -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 Fix occurences of c_str() used with size() to data() 2019-10-28 13:41:45 +01:00
crypter.h Convert wallet to new serialization 2020-05-24 10:34:52 -07:00
db.cpp walletdb: Move BDB specific things into bdb.{cpp/h} 2020-06-15 20:41:05 -04:00
db.h Introduce DummyDatabase and use it in the tests 2020-07-29 12:28:30 -04:00
feebumper.cpp wallet: Remove trailing whitespace from potential translation strings 2020-05-01 07:41:32 -04:00
feebumper.h wallet: Avoid translating RPC errors when creating txs 2020-05-01 07:39:06 -04:00
fees.cpp Remove unused includes 2019-10-15 22:56:43 +00:00
fees.h Remove uses of fee globals in wallet code 2019-02-22 15:43:02 -04:00
init.cpp scripted-diff: Replace gArgs with local argsman 2020-07-29 16:39:00 +07:00
ismine.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
load.cpp walletdb: Move BerkeleyDatabase::Flush(true) to Close() 2020-07-14 11:07:16 -04:00
load.h wallet: Pass unused args to StartWallets 2020-07-09 13:07:37 +02:00
rpcdump.cpp refactor: Make HexStr take a span 2020-08-06 19:41:43 +02:00
rpcwallet.cpp Merge #19644: rpc: document returned error fields as optional if applicable 2020-08-14 09:57:58 +12:00
rpcwallet.h refactor: Combine GetWalletForJSONRPCRequest and EnsureWalletIsAvailable functions 2020-06-05 08:29:18 -04:00
salvage.cpp walletdb: Don't remove database transaction logs and instead error 2020-07-13 11:00:54 -04:00
salvage.h Move RecoverKeysOnlyFilter into RecoverDataBaseFile 2020-05-25 12:59:29 -04:00
scriptpubkeyman.cpp Merge #19046: Replace CWallet::Set* functions that use memonly with Add/Load variants 2020-07-11 23:08:54 +12:00
scriptpubkeyman.h Merge #19046: Replace CWallet::Set* functions that use memonly with Add/Load variants 2020-07-11 23:08:54 +12:00
wallet.cpp Merge #19568: Wallet should not override signing errors 2020-08-14 16:04:31 +08:00
wallet.h walletdb: Move BerkeleyDatabase::Flush(true) to Close() 2020-07-14 11:07:16 -04:00
walletdb.cpp Make Hash[160] consume range-like objects 2020-07-30 13:57:54 -07:00
walletdb.h walletdb: Introduce WalletDatabase abstract class 2020-07-14 11:07:16 -04:00
wallettool.cpp walletdb: Move BerkeleyDatabase::Flush(true) to Close() 2020-07-14 11:07:16 -04:00
wallettool.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
walletutil.cpp Correctly check for default wallet 2020-04-23 13:59:48 -04:00
walletutil.h Convert wallet to new serialization 2020-05-24 10:34:52 -07:00