Commit graph

246 commits

Author SHA1 Message Date
Andrew Poelstra
f766518acd Merge 9ab9665c74 into merged_master (Bitcoin PR #15710) 2020-12-03 06:48:14 +00:00
Andrew Poelstra
f3afbf3d85 Merge f3727fd735 into merged_master (Bitcoin PR #20156) 2020-12-01 18:41:26 +00:00
Andrew Poelstra
4eeadb7fde Merge 8ed37f6c84 into merged_master (Bitcoin PR #19077) 2020-11-30 20:20:56 +00:00
Andrew Poelstra
d4e8eb56b0 Merge 56d47e19ed into merged_master (Bitcoin PR #19619) 2020-11-29 00:21:17 +00:00
Andrew Poelstra
e7d708436f Merge 68f0ab26bc into merged_master (Bitcoin PR #19805) 2020-11-28 21:36:21 +00:00
Andrew Poelstra
afe472121a Merge a1d14f522c into merged_master (Bitcoin PR #19671) 2020-11-28 19:48:53 +00:00
Andrew Poelstra
54f2d85914 Merge 34eb236258 into merged_master (Bitcoin PR #19326) 2020-11-27 00:39:12 +00:00
Andrew Poelstra
f6c714b963 Merge 37b765b962 into merged_master (Bitcoin PR #19102) 2020-11-26 22:07:27 +00:00
Andrew Poelstra
7297f932a0 Merge 9d4b3d86b6 into merged_master (Bitcoin PR #19334) 2020-11-26 17:07:31 +00:00
Andrew Poelstra
524d0a7d4d Merge a924f61cae into merged_master (Bitcoin PR #19325) 2020-11-26 03:28:15 +00:00
Andrew Poelstra
d41cf5fe1c Merge 160800ac10 into merged_master (Bitcoin PR #19441) 2020-11-26 01:09:24 +00:00
Andrew Poelstra
7cd7baf583 Merge 5f96bce9b7 into merged_master (Bitcoin PR #18923) 2020-11-26 01:09:24 +00:00
Andrew Poelstra
fc95b9bd68 Merge 89899a3448 into merged_master (Bitcoin PR #19046) 2020-11-26 01:09:24 +00:00
Andrew Poelstra
9942d6f945 Merge 171f4a516b into merged_master (Bitcoin PR #19324) 2020-11-26 01:09:19 +00:00
Andrew Poelstra
bc6c7eaaed Merge 26291745ae into merged_master (Bitcoin PR #19308) 2020-11-26 01:09:16 +00:00
Andrew Poelstra
fa10c4dfe5 Merge bd331bd745 into merged_master (Bitcoin PR #17938)
Also re-`static`'d a method in src/script/standard.cpp which we had made globally
visible for some historical reason, but which I noticed diffing that file against
upstream.
2020-11-26 01:09:10 +00:00
Andrew Poelstra
d497b27545 Merge d4f9ae0025 into merged_master (Bitcoin PR #19054) 2020-11-26 01:09:09 +00:00
Andrew Poelstra
b99679fa3c Merge dbd7a91fdf into merged_master (Bitcoin PR #19310) 2020-11-26 01:09:08 +00:00
Andrew Poelstra
b5d56ca95c Merge 62d863f915 into merged_master (Bitcoin PR #19290) 2020-11-26 01:09:06 +00:00
Andrew Poelstra
ab6a586b75 Merge 5879bfa9a5 into merged_master (Bitcoin PR #18792) 2020-11-26 01:08:56 +00:00
Andrew Poelstra
d38085da61 Merge 520e435b5e into merged_master (Bitcoin PR #18918) 2020-11-26 01:08:51 +00:00
Andrew Poelstra
5800ec9196 Merge ccd85b57af into merged_master (Bitcoin PR #17681) 2020-11-26 01:08:48 +00:00
Andrew Poelstra
e1392efa4f Merge 9abed46871 into merged_master (Bitcoin PR #16946) 2020-11-26 01:08:48 +00:00
Andrew Poelstra
e5faae4af6 Merge 60091d20f9 into merged_master (Bitcoin PR #9381) 2020-11-26 01:08:38 +00:00
Andrew Poelstra
d4711bdf91 Merge 23c926d859 into merged_master (Bitcoin PR #18699) 2020-11-26 01:08:37 +00:00
Andrew Poelstra
1c12ae1719 Merge eef90c14ed into merged_master (Bitcoin PR #16528)
This is the 43-commit descriptor wallet PR. It was remarkably easy to merge, given
its magnitude. With this commit Elements supports importing Bitcoin descriptors
and deriving (Bitcoin) addresses, though of course it does not support blinding
yet. That is a post-rebase project.

The material changes were:

1. Changing constants in the tests (super annoying but nothing surprising)

2. Adding a missing "skip if this coin is not ours" check in src/script/sign.cpp
   which was causing us to erroneously remove existing witnesses from transactions.
   This wasn't a problem before this commit since we would only ask specific
   scriptpubkeymans to sign, and we'd never ask any to sign inputs we didn't
   own. Andy simplified the logic here to always try every scriptpubkeyman,
   which means they have to play a bit more nicely with each other.

Other than that, this was a big diff with many conflicts but literally all of
them were "we both added code" and the resolution was to take both sides.
2020-11-26 01:08:31 +00:00
Andrew Poelstra
fd37b7c5d6 Merge 54f812d9d2 into merged_master (Bitcoin PR #18673) 2020-11-26 01:08:23 +00:00
Andrew Poelstra
879cfb6ad8 Merge c5966a87d1 into merged_master (Bitcoin PR #18192) 2020-11-26 01:08:11 +00:00
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
Andrew Poelstra
91e195d7cd Merge 2d6e76af24 into merged_master (Bitcoin PR #17261)
Moved GetOnlinePakKey to the scriptpubkey manager; the other blinding
stuff remains in the CWallet. At some point after the rebase we should
consider whether there's a better separation to be had between the PAK
related stuff now that we have wallet boxes.
2020-11-14 17:16:10 +00:00
Andrew Poelstra
f94f8bdfe9 Merge cef7df37ce into merged_master (Bitcoin PR #17410) 2020-11-09 23:10:09 +00:00
Andrew Poelstra
e910b15aa8 Merge 6a97e8a060 into merged_master (Bitcoin PR #17260) (multiple commits)
This is the start of some nontrivial wallet refactoring by achow. See
https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Class-Structure-Changes
for a high-level design.

This PR moves some stuff out of CWallet into a dummy "box" LegacyScriptPubKeyMan
which is (currently) very tightly coulped to CWallet. Because of the coupling there
are currently null-checks that cannot fail, things which assume non-nullness which
will eventually be wrong, and a plethora of currently-equivalent ways to get from
a CWallet to a provider or back.

Our approach is basically to ignore the refactoring; leave the blinding key stuff
in CWallet and have it call into the wallet's provider when we are obtaining the
underlying keys.

Later, probably in a post-rebase PR, we should rethink how we manage blinding keys
to more closely match Core's "all keys go into providers" model.
2020-11-09 21:20:47 +00:00
Andrew Poelstra
da8069b810 Merge a884b32854 into merged_master (Bitcoin PR #16911) 2020-11-09 21:20:43 +00:00
Andrew Poelstra
42a1dc16a6 Merge a22b62481a into merged_master (Bitcoin PR #17070) 2020-11-09 21:20:43 +00:00
Andrew Poelstra
4c14f6c4c9 Merge b7fbf74b98 into merged_master (Bitcoin PR #16502) 2020-11-09 21:20:11 +00:00
Andrew Poelstra
26b55cf757 Merge ff57fb4578 into merged_master (Bitcoin PR #15709) 2020-11-09 21:20:10 +00:00
Andrew Poelstra
cf718f2179 Merge 478fe328a7 into merged_master (Bitcoin PR #16475) 2020-11-09 21:20:09 +00:00
Andrew Poelstra
4b3841c699 Merge febf3a856b into merged_master (Bitcoin PR #15588) 2020-11-09 21:20:08 +00:00
Andrew Poelstra
5cb1c16c7d Merge d5931f3676 into merged_master (Bitcoin PR #15870) 2020-10-29 18:02:26 +00:00
Andrew Poelstra
a8581ea138 Merge 6a135fbe5b into merged_master (Bitcoin PR #15638) 2020-10-28 03:16:57 +00:00
Andrew Poelstra
aa93130e24 Merge 7ec7aea442 into merged_master (Bitcoin PR #15491) 2020-10-27 23:50:29 +00:00
Luke Dashjr
7b54d768e1 Make sqlite support optional (compile-time) 2020-10-20 13:44:43 +00:00
Andrew Chow
ac38a87225 Determine wallet file type based on file magic 2020-10-14 11:28:18 -04:00
Russell Yanofsky
7bf6dfbb48 wallet: Remove path checking code from bitcoin-wallet tool
This commit does not change behavior except for error messages which now
include more complete information.
2020-09-03 12:24:32 -04:00
Russell Yanofsky
3c815cfe54 wallet: Remove Verify and IsLoaded methods
Checks are now consolidated in MakeBerkeleyDatabase function instead of
happening in higher level code.

This commit does not change behavior except for error messages which now
include more complete information.
2020-09-03 12:24:32 -04:00
Russell Yanofsky
b5b414151a wallet: Add MakeDatabase function
New function is not currently called but will be called in upcoming commits. It
moves database path checking, and existence checking, and already-loaded
checking, and verification into a single function so this logic does not need
to be repeated all over higher level wallet code, and so higher level code does
not need to change when SQLite support is added in
https://github.com/bitcoin/bitcoin/pull/19077. This also lets higher level
wallet code make fewer assumptions about the contents of wallet directories.

This commit just adds the new function and does not change behavior in any way.
2020-09-03 12:24:32 -04:00
fanquake
68f0ab26bc
Merge #19805: wallet: Avoid deserializing unused records when salvaging
0bbe26a1af wallet: filter for keys only before record deser in salvage (Andrew Chow)
544e12a4e8 walletdb: Add KeyFilterFn to ReadKeyValue (Andrew Chow)

Pull request description:

  When salvaging a wallet, the only things that matter are the private keys. It is not necessary to attempt to deserialize any other records, especially if those records are corrupted too.

  This PR adds a `KeyFilterFn` function callback to `ReadKeyValue` that salvage uses to filter for only the records that it wants. Of course doing it this way also lets us do other filters in the future from other places should we so desire.

ACKs for top commit:
  ryanofsky:
    Code review ACK 0bbe26a1af. Looks great! This should make the recovery code more robust. Normally it'd be good to have a test case for the problem this fixes, but Marco already wrote one in #19078, so I think we're covered
  laanwj:
    Code review ACK 0bbe26a1af

Tree-SHA512: 8e3ee283a22a79273915711c4fb751f3c9b02ce94e6bf08dc468f1cfdf9fac35c693bbfd2435ce43c3a06c601b9b0a67e209621f6814bedfe3bc7a7ccc37bb01
2020-09-03 12:47:01 +08:00
Andrew Chow
3340dbadd3 Remove -zapwallettxes
-zapwallettxes is made a hidden option to inform users that it is
removed and they should be using abandontransaction to do the stuck
transaction thing.
2020-08-31 12:39:19 -04:00
Andrew Chow
544e12a4e8 walletdb: Add KeyFilterFn to ReadKeyValue
Add a KeyFilterFn callback to ReadKeyValue which allows the caller to
specify which types to actually deserialize. A KeyFilterFn takes the
type as the parameter and returns a bool indicating whether
deserialization should continue.
2020-08-25 13:23:40 -04:00
Pieter Wuille
77c507358b Make Hash[160] consume range-like objects 2020-07-30 13:57:54 -07:00