Commit graph

157 commits

Author SHA1 Message Date
Andrew Poelstra
d4711bdf91 Merge 23c926d859 into merged_master (Bitcoin PR #18699) 2020-11-26 01:08:37 +00:00
Andrew Poelstra
4414990576 Merge 608359b071 into merged_master (Bitcoin PR #16426) 2020-11-26 01:08:35 +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
23cab4213a Merge 4702cadca9 into merged_master (Bitcoin PR #17954) 2020-11-26 01:08:19 +00:00
Andrew Poelstra
90081b0645 Merge 99d6a5be8b into merged_master (Bitcoin PR #17999) 2020-11-26 01:08:16 +00:00
Andrew Poelstra
0a87d878fa Merge 63dad67348 into merged_master (Bitcoin PR #18546) 2020-11-26 01:08:12 +00:00
Andrew Poelstra
879cfb6ad8 Merge c5966a87d1 into merged_master (Bitcoin PR #18192) 2020-11-26 01:08:11 +00:00
Andrew Poelstra
943443791e Merge f2880e21ef into merged_master (Bitcoin PR #18160) 2020-11-26 01:08:05 +00:00
Andrew Poelstra
bdd87dc5fa Merge 694f4cbd78 into merged_master (Bitcoin PR #18312) 2020-11-26 01:08:02 +00:00
Andrew Poelstra
90c7d5774a Merge ac579ada7e into merged_master (Bitcoin PR #18278) 2020-11-26 01:08:00 +00:00
Andrew Poelstra
5b9f316537 Merge dcf2ccbfde into merged_master (Bitcoin PR #18115)
I really like this PR, but it wound up being pretty nontrivial to merge.
The crux is that it pulls PSBT signing logic into scriptpubkey manager,
which is where it belongs, but for us this means reasoning about pegins
inside script/sign.cpp.

However, sign.cpp is part of libbitcoin_common, which does not include
anything for reasoning about PoW or RPC (lol) or anything heavy about
that. This means that some pegin validation had to remain split between
the wallet/rpc layer and sign.cpp. I added a new file script/pegins.cpp
which has the (one) method we actually need in sign.cpp.

Aside from that, this diff is very large but is mostly just moving our
code changes to wallet/psbtwallet.* into wallet/wallet.* where those
functions now live. As far as review, it's probably not worthwhile to
spend too much too much time on this since it's going to be change
again in #16528 and others. The test coverage is pretty extensive.
2020-11-26 01:07:51 +00:00
Andrew Poelstra
5bbbba1ce1 Merge 4d80274b99 into merged_master (Bitcoin PR #18241) 2020-11-26 01:07:50 +00: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
009bc2fdfb Merge 99813a9745 into merged_master (Bitcoin PR #17829) 2020-11-14 16:52:02 +00:00
Andrew Poelstra
ba08079170 Merge 0aa72061e5 into merged_master (Bitcoin PR #16944) 2020-11-14 16:51:47 +00:00
Andrew Poelstra
9239882c43 Merge 8aac85d71e into merged_master (Bitcoin PR #17371) 2020-11-14 16:51:41 +00:00
Andrew Poelstra
c1d327d827 Merge 4a3b6f47cd into merged_master (Bitcoin PR #17354) 2020-11-09 23:10:09 +00:00
Andrew Poelstra
cfde15703a Merge 99ab3a72c5 into merged_master (Bitcoin PR #15931) 2020-11-09 23:10:09 +00:00
Andrew Poelstra
34af974d28 Merge 471e5f8829 into merged_master (Bitcoin PR #16839) 2020-11-09 21:20:47 +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
fc2108d672 Merge 8a191148db into merged_master (Bitcoin PR #17154) 2020-11-09 21:20:43 +00:00
Andrew Poelstra
821f5256a5 Merge 46d6930f8c into merged_master (Bitcoin PR #16659) 2020-11-09 21:20:41 +00:00
Andrew Poelstra
a7df99d033 Merge e180be49d7 into merged_master (Bitcoin PR #17098) 2020-11-09 21:20:40 +00:00
Andrew Poelstra
29e73c226a Merge 5e202382a9 into merged_master (Bitcoin PR #16624) 2020-11-09 21:20:21 +00:00
Andrew Poelstra
7ce3241549 Merge 66c5045d5a into merged_master (Elements PR #693)
Fixes bug I mentioned when merging Bitcoin #16415
2020-11-09 21:20:20 +00:00
Andrew Poelstra
0888ad0cf3 Merge 1139e3cb76 into merged_master (Bitcoin PR #16415) 2020-11-09 21:20:08 +00:00
Andrew Poelstra
152198061a Merge 459baa1756 into merged_master (Bitcoin PR #16208) 2020-11-09 21:20:06 +00:00
Andrew Poelstra
a50b652932 Merge 735d6b57e7 into merged_master (Bitcoin PR #16227) 2020-11-09 03:58:21 +00:00
Andrew Poelstra
0065d674a4 Merge 8d1286014c into merged_master (Bitcoin PR #16237)
I'm sorry, this should have been a few commits, but it got away from me
as the scope of this refactoring was not immediately obvious. It essentially
just moves code around so hopefully is not too hard to review. --asp
2020-11-09 03:58:21 +00:00
Andrew Poelstra
f68fbc1a56 Merge fd333e15a5 into merged_master (Bitcoin PR #16226) 2020-11-06 15:20:16 +00:00
Andrew Poelstra
68d9951825 Merge d0f81a96d9 into merged_master (Bitcoin PR #16129) 2020-11-06 15:20:13 +00:00
Andrew Poelstra
c6ad410dd9 Merge a6beb256ed into merged_master (Elements PR #629) 2020-11-06 15:20:11 +00:00
Andrew Poelstra
ad0dc00fc2 Merge 3356799ee3 into merged_master (Bitcoin PR #15778) 2020-10-28 23:22:29 +00:00
Andrew Poelstra
1c4e3cbb5f Merge 4f4ef3138b into merged_master (Bitcoin PR #15557)
This restricts the `bumpfee` RPC, when given a feerate target, to unblinded
transactions, because this is the only way I could figure out quickly to
allow adding inputs to an already-created transaction. It appears to be the
strategy used by the `fundrawtransaction` RPC which has similar behaviour.
This should be fixed in a followup PR.
2020-10-28 15:36:05 +00:00
Andrew Poelstra
a8581ea138 Merge 6a135fbe5b into merged_master (Bitcoin PR #15638) 2020-10-28 03:16:57 +00:00
Andrew Poelstra
ccc0b0afff Merge db2985651d into merged_master (Bitcoin PR #15747) 2020-10-28 01:43:49 +00:00
Andrew Poelstra
5f340cc9ac Merge 2607d960a0 into merged_master (Bitcoin PR #10973) 2020-10-28 00:10:27 +00:00
Andrew Poelstra
edfdf46351 Merge 45f434f44d into merged_master (Bitcoin PR #15288) 2020-10-27 21:55:08 +00:00
MarcoFalke
fae7776690
wallet: Avoid translating RPC errors when creating txs
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-01 07:39:06 -04:00
Antoine Riard
6a72f26968 [wallet] Remove locked_chain from CWallet, its RPCs and tests
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 14:41:24 -04:00
Antoine Riard
841178820d [wallet] Move methods from Chain::Lock interface to simple Chain
Remove findPruned and findFork, no more used after 17954.
2020-04-30 14:37:21 -04:00
Antoine Riard
b855592d83 [wallet] Move getHeight from Chain::Lock interface to simple Chain
Instead of calling getHeight, we rely on CWallet::m_last_block
processed_height where it's possible.
2020-04-30 14:31:19 -04:00
Andrew Chow
ce24a94494 Add IsLegacy to CWallet so that the GUI knows whether to show watchonly 2020-04-23 13:59:48 -04:00
MarcoFalke
fa488f131f
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
MarcoFalke
4702cadca9
Merge #17954: wallet: Remove calls to Chain::Lock methods
48973402d8 wallet: Avoid use of Chain::Lock in CWallet::GetKeyBirthTimes (Russell Yanofsky)
e958ff9ab5 wallet: Avoid use of Chain::Lock in CWallet::CreateTransaction (Russell Yanofsky)
c0d07dc4cb wallet: Avoid use of Chain::Lock in CWallet::ScanForWalletTransactions (Russell Yanofsky)
1be8ff280c wallet: Avoid use of Chain::Lock in rescanblockchain (Russell Yanofsky)
3cb85ac594 wallet refactor: Avoid use of Chain::Lock in CWallet::RescanFromTime (Russell Yanofsky)
f7ba881bc6 wallet: Avoid use of Chain::Lock in listsinceblock (Russell Yanofsky)
bc96a9bfc6 wallet: Avoid use of Chain::Lock in importmulti (Russell Yanofsky)
25a9fcf9e5 wallet: Avoid use of Chain::Lock in importwallet and dumpwallet (Russell Yanofsky)
c1694ce6bb wallet: Avoid use of Chain::Lock in importprunedfunds (Russell Yanofsky)
ade5f87971 wallet refactor: Avoid use of Chain::Lock in qt wallettests (Russell Yanofsky)
f6da44ccce wallet: Avoid use of Chain::Lock in tryGetTxStatus and tryGetBalances (Russell Yanofsky)
bf30cd4922 refactor: Add interfaces::FoundBlock class to selectively return block data (Russell Yanofsky)

Pull request description:

  This is a set of changes updating wallet code to make fewer calls to `Chain::Lock` methods, so the `Chain::Lock` class will be easier to remove in #16426 with fewer code changes and small changes to behavior.

ACKs for top commit:
  MarcoFalke:
    re-ACK 48973402d8, only change is fixing bug 📀
  fjahr:
    re-ACK 48973402d8, reviewed rebase and changes since last review, built and ran tests locally
  ariard:
    Coce Review ACK 4897340, only changes are one suggested by last review on more accurate variable naming, human-readable output, args comments in `findCommonAncestor`

Tree-SHA512: cfd2f559f976b6faaa032794c40c9659191d5597b013abcb6c7968d36b2abb2b14d4e596f8ed8b9a077e96522365261299a241a939b3111eaf729ba0c3ef519b
2020-04-14 07:18:12 -04:00
MarcoFalke
99d6a5be8b
Merge #17999: refactor: Add ChainClient setMockTime, getWallets methods
3ce16ad2f9 refactor: Use psbt forward declaration (Russell Yanofsky)
1dde238f2c Add ChainClient setMockTime, getWallets methods (Russell Yanofsky)

Pull request description:

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).

  These changes are needed to set mock times, and get wallet interface pointers correctly when
  wallet code is running in a different process from node code in #10102

ACKs for top commit:
  MarcoFalke:
    re-ACK 3ce16ad2f9 🔙
  promag:
    Code review ACK 3ce16ad2f9.

Tree-SHA512: 6c093bfcd68adf5858a1aade4361cdb7fb015496673504ac7a93d0bd2595215047184551d6fd526baa27782331cd2819ce45c4cf923b205ce93ac29e485b5dd8
2020-04-10 12:57:35 -04:00
Luke Dashjr
2952c46b92 Wallet: Replace CAddressBookData.name with GetLabel() method 2020-04-06 20:52:04 +00:00
Luke Dashjr
c751d886f4 Wallet: Avoid treating change-in-the-addressbook as non-change everywhere 2020-04-02 16:25:17 +00:00
Luke Dashjr
b86cd155f6 scripted-diff: Wallet: Rename mapAddressBook to m_address_book
Previous versions assumed absence of an entry in mapAddressBook indicated change.
This no longer holds true (due to bugs) and will shortly be made intentional.
Renaming the field helps ensure that old code using mapAddressBook directly gets checked for necessary rebasing.

-BEGIN VERIFY SCRIPT-
sed -i -e 's/mapAddressBook/m_address_book/g' $(git grep -l 'mapAddressBook' ./src)
-END VERIFY SCRIPT-
2020-04-02 16:00:28 +00:00