Commit graph

497 commits

Author SHA1 Message Date
Andrew Chow
e37439775a Implement and enable decodepsbt for PSET 2021-06-22 13:54:50 -04:00
Andrew Chow
f4bca18784 Restrict joinpsbts to PSBTv0 only 2021-06-22 13:54:50 -04:00
Andrew Chow
ebc49e3111 Allow createpsbt and walletcreatefundedpsbt to take psbt version 2021-06-22 13:54:50 -04:00
Andrew Chow
2c1fe5841f Allow and create PSBTv2 in RPCs 2021-06-22 13:54:50 -04:00
Andrew Chow
bedc1e0fec Implement PSBTv2 in decodepsbt 2021-06-22 13:54:50 -04:00
Andrew Chow
9c8330024a Update RPCs for PSBTv2 2021-06-22 13:54:50 -04:00
Andrew Chow
cd5515a266 Change PSBT::AddOutput to take just PSBTOutput 2021-06-22 13:54:50 -04:00
Andrew Chow
90cd7ec5d5 Change PSBT::AddInput to take just PSBTInput 2021-06-22 13:54:50 -04:00
Andrew Chow
2042765520 Have PSBTInput and PSBTOutput know the PSBT's version 2021-06-22 13:54:50 -04:00
Andrew Chow
20e8dff880 Merge global xpubs in joinpsbts and combinepsbts 2021-06-22 13:54:50 -04:00
Andrew Chow
7fd50b2795 Add global_xpubs to decodepsbt 2021-06-22 13:54:50 -04:00
Andrew Chow
5bb930e0b4 Output proprietary type info in decodepsbt 2021-06-03 15:44:20 -04:00
Andrew Chow
25c13ad3b8 Output psbt version in decodepsbt 2021-06-03 15:44:20 -04:00
Andrew Chow
fdf71def4c Remove PSET and disable PSBT/PSET things for now
Reset back to Bitcoin PSBT and disable PSBT/PSET handling in wallet and
rpc.

This is just a reset to allow for PSBTv2 change and then a new and
improved PSET.
2021-06-03 15:44:19 -04:00
Andrew Poelstra
14ff891036 Various ubsan fixes
Mostly harmless signed/unsigned conversions but also an actual
memory leak related to `BlindingData`.
2021-03-26 17:33:05 +00:00
Andrew Poelstra
1e98c9fa9e fix RPC linter issues 2021-03-26 17:33:02 +00:00
Andrew Poelstra
e483648523 Merge cbb5f3a2d5 into merged_master (Bitcoin PR #19836) 2020-12-01 04:16:10 +00:00
Andrew Poelstra
ab283556b0 Merge db88db4727 into merged_master (Bitcoin PR #19339)
Changes API for AcceptToMemoryPool to no longer check maximum fee; we remove
this check from interfaces::CChain::testPeginClaimAcceptance. This is fine,
the check never should have been there (this method's job is to notice double
claim attempts and provide a more helpful message to the user; other mempool
failures should be caught later in the `claimrawpegin` logic when we call
`pwallet->commitTransaction` which actually subits to the mempool). It was
only checking fees because the API made it easier to do so than to not.
2020-11-30 15:50:18 +00:00
Andrew Poelstra
0bc6dbbce1 Merge e6207229b8 into merged_master (Elements PR #911)
Spent a while figuring out where this new function should live now that
the PSBT stuff has been pulled into src/psbt.cpp and the wallet, and isn't
mixed up with the RPC logic.

In the end I modified the the function to return a normal error rather
than throwing an RPC exception and put it in src/psbt.cpp with the other
functions that behave this way.
2020-11-30 14:31:38 +00:00
Andrew Poelstra
5c1a330c57 Merge d692d192cd into merged_master (Bitcoin PR #19849)
More RPC cleanups. This one discovered that the `createpsbt` and
`rawblindrawtransaction` RPCs had incorrect argument lists :)
2020-11-29 17:58:59 +00:00
Andrew Poelstra
81a3dda09b Merge c30f79d418 into merged_master (Bitcoin PR #19940) 2020-11-29 14:00:02 +00:00
Andrew Poelstra
2a0cf12ecc Merge 07087051af into merged_master (Bitcoin PR #19556)
Added a method testPeginClaimAcceptance to interfaces::CChain. It is not clear
to me that this is meaningfully different from the existing method broadcastTransaction
(with the `relay` flag set to false so it doesn't actually broadcast), except
that this method returns the TxValidationState, which we display to the user
in the RPC error. Worth revisiting this.

Another nonobvious change was replacing a block of mempool-searching logic
in wallet/rpcwallet.cpp with the single line `pwallet->chain().findCoins(coins)`.
This I stole from the current state of upstream #17211, our favorite in-progress
PR from which the original logic came.
2020-11-29 01:43:20 +00:00
Andrew Poelstra
4393de33e3 Merge df75e9f3ee into merged_master (Bitcoin PR #19878) 2020-11-28 23:10:31 +00:00
Andrew Poelstra
2a04500584 Merge a12d9e5fd2 into merged_master (Bitcoin PR #19687) 2020-11-28 13:35:24 +00:00
Andrew Poelstra
5902895d0c Merge 31760bb7c9 into merged_master (Bitcoin PR #19528) 2020-11-27 18:39:01 +00:00
Andrew Poelstra
08378e5ad8 Merge 609ce2d0da into merged_master (Bitcoin PR #19644) 2020-11-27 18:05:45 +00:00
Andrew Poelstra
419fd4f90d Merge b75f2ad72d into merged_master (Bitcoin PR #19660) 2020-11-27 04:05:36 +00:00
Andrew Poelstra
54f2d85914 Merge 34eb236258 into merged_master (Bitcoin PR #19326) 2020-11-27 00:39:12 +00:00
Andrew Poelstra
21f9f41bf4 Merge a1da180b1b into merged_master (Bitcoin PR #19589) 2020-11-26 19:33:53 +00:00
Andrew Poelstra
50d06f59f3 Merge db9f1b9edc into merged_master (Elements PR #896) 2020-11-26 19:16:44 +00:00
Andrew Poelstra
f36832a9dd Merge f5000ae66c into merged_master (Bitcoin PR #19555) 2020-11-26 14:11:14 +00:00
Andrew Poelstra
c6cb7be640 Merge c57dc566b0 into merged_master (Bitcoin PR #16525) 2020-11-26 12:15:14 +00:00
Andrew Poelstra
262c624540 Merge 032cfdc9a2 into merged_master (Bitcoin PR #19517) 2020-11-26 04:17:00 +00:00
Andrew Poelstra
1aa51f0c4c Merge b52e25cc1b into merged_master (Bitcoin PR #19328) 2020-11-26 01:09:20 +00:00
Andrew Poelstra
d664527f5a Merge a24806c25d into merged_master (Bitcoin PR #19215) 2020-11-26 01:09:18 +00:00
Andrew Poelstra
dc44b27189 Merge d3a5dbfd1f into merged_master (Bitcoin PR #19114) 2020-11-26 01:09:14 +00:00
Andrew Poelstra
b431cfa2d7 Merge 532b134cb0 into merged_master (Bitcoin PR #19373) 2020-11-26 01:09:12 +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
51965ad1e6 Merge 25ad2c623a into merged_master (Bitcoin PR #18740) 2020-11-26 01:08:47 +00:00
Andrew Poelstra
1ea940a2e2 Merge 4f802e59a0 into merged_master (Bitcoin PR #17509) 2020-11-26 01:08:28 +00:00
Andrew Poelstra
fd37b7c5d6 Merge 54f812d9d2 into merged_master (Bitcoin PR #18673) 2020-11-26 01:08:23 +00:00
Andrew Poelstra
bc49e22548 Merge f0d97cdf70 into merged_master (Elements PR #861) 2020-11-26 01:08:22 +00:00
Andrew Poelstra
d6d099ce1c Merge 76143bf714 into merged_master (Bitcoin PR #18495) 2020-11-26 01:08:17 +00:00
Andrew Poelstra
c8909955fa Merge 1b151e3ffc into merged_master (Bitcoin PR #18532) 2020-11-26 01:08:13 +00:00
Andrew Poelstra
5b3e849748 Merge 2e97d80017 into merged_master (Bitcoin PR #18134) 2020-11-26 01:08:02 +00:00
Andrew Poelstra
cf81cec06c Merge 58c72880ff into merged_master (Bitcoin PR #18268) 2020-11-26 01:07:54 +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
91b1e1b4ab Merge a71c34742c into merged_master (Bitcoin PR #17809)
This was pretty-much as awful as it looks.
2020-11-26 01:07:48 +00:00
Andrew Poelstra
e81fccc9a5 Merge 263f53e2d0 into merged_master (Bitcoin PR #18098) 2020-11-26 01:07:43 +00:00
Andrew Poelstra
d20bafff5e Merge 712b7d9b47 into merged_master (Bitcoin PR #17804) 2020-11-26 00:29:45 +00:00