Commit graph

487 commits

Author SHA1 Message Date
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
Andrew Poelstra
68d0a25901 Merge 1326092e6c into merged_master (Bitcoin PR #17156)
This fixes a segfault I introduced in 981df590811 (#17371) a couple hundred PRs
ago, where we might out-of-bounds access the vout arrray of a non_witness_utxo
transaction in a PSBT.

This logic should probably be refactored after the rebase -- we sift through
the non_witness_utxos to find a scriptpubkey, which we use to get a wallet
provider, so we can pass this to SignPSBTInput, which then repeats the same
logic (for its own reasons, and without the segfault bug)....and we aren't
even calling SignPSBTInput for signing reasons! It has something to do with
blinding.
2020-11-14 16:52:12 +00:00
Andrew Poelstra
4219b6d7d9 Merge 48d64d73c0 into merged_master (Bitcoin PR #17564) 2020-11-14 16:51:59 +00:00
Andrew Poelstra
fe9767f625 Merge d4b335c60a into merged_master (Bitcoin PR #17617) 2020-11-14 16:51:58 +00:00
Andrew Poelstra
473008e9e0 Merge f1d3d3430e into merged_master (Bitcoin PR #17714) 2020-11-14 16:51:57 +00:00
Andrew Poelstra
9709d02c23 Merge fae94785d9 into merged_master (Bitcoin PR #17524)
lol converting the psbt test vector to a pset one was pretty brutal. Conversion to
hex using rust-bitcoin and then manual hex-editing in vim.
2020-11-14 16:51:56 +00:00
Andrew Poelstra
fd78a12518 Merge 2949ea924f into merged_master (Elements PR #751) 2020-11-14 16:51:52 +00:00
Andrew Poelstra
9239882c43 Merge 8aac85d71e into merged_master (Bitcoin PR #17371) 2020-11-14 16:51:41 +00:00
Andrew Poelstra
c82f65f262 Merge 73b26e38d7 into merged_master (Bitcoin PR #17351) 2020-11-09 21:20:50 +00:00
Andrew Poelstra
bde84fefc4 Merge 3c40bc6726 into merged_master (Bitcoin PR #15921) 2020-11-09 21:20:48 +00:00
Andrew Poelstra
34af974d28 Merge 471e5f8829 into merged_master (Bitcoin PR #16839) 2020-11-09 21:20:47 +00:00