Commit graph

1123 commits

Author SHA1 Message Date
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
1108aae86c Merge 54fc96ffa7 into merged_master (Bitcoin PR #19956) 2020-11-30 05:40:00 +00:00
Andrew Poelstra
33a0d5e270 Merge 301959fa74 into merged_master (Bitcoin PR #20043) 2020-11-30 02:42:44 +00:00
Andrew Poelstra
1b85209c18 Merge 1769828684 into merged_master (Bitcoin PR #19501)
Adds "verbose" flag to a bunch of RPC that pass through to SendMoney. I also
added it to sendtomainchain and destroyamount.
2020-11-30 02:17:54 +00:00
Andrew Poelstra
3a833cdb0e Merge e36aa351a3 into merged_master (Bitcoin PR #19969) 2020-11-29 23:45:31 +00:00
Andrew Poelstra
915a1a4182 Merge 5e14fafb31 into merged_master (Bitcoin PR #19994)
We have a couple RPC hacks in src/wallet/rpcwallet.cpp that were a bit annoying
to adapt, but nothing too bad.

Found a misspelling of `ignoreblindfail` in the `sendtoaddress` args, and a
discrepancy in the `createrawpegin`/`createpegin` args
2020-11-29 20:51:00 +00:00
Andrew Poelstra
5e62edcf8e Merge ffaac6e614 into merged_master (Bitcoin PR #16378)
Adds a new "send" RPC which I didn't really look at too closely to match
our other RPC modifications. In particular our backport of #17211 adds a
"solving_data" field to other transaction-creation RPCs, but not this
one. (But I checked the current status of #17211 and Andy hasn't updated
upstream either, just passes NullUniValue to FundTransaction from `send`.
So that's what I did here.)
2020-11-29 04:33:22 +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
d4e8eb56b0 Merge 56d47e19ed into merged_master (Bitcoin PR #19619) 2020-11-29 00:21:17 +00:00
Andrew Poelstra
646aa14168 Merge a0a422c34c into merged_master (Bitcoin PR #19754) 2020-11-28 22:31:57 +00:00
Andrew Poelstra
afe472121a Merge a1d14f522c into merged_master (Bitcoin PR #19671) 2020-11-28 19:48:53 +00:00
Andrew Poelstra
ad7f014d11 Merge 89a8299a14 into merged_master (Bitcoin PR #19717) 2020-11-28 19:34:51 +00:00
Andrew Poelstra
5f6eb8ee3f Merge f98872f127 into merged_master (Bitcoin PR #18244) 2020-11-28 18:55:44 +00:00
Andrew Poelstra
5f1e116d89 Merge b987e657cd into merged_master (Bitcoin PR #19169) 2020-11-28 14:55:17 +00:00
Andrew Poelstra
3ca887d480 Merge d052f5e6b7 into merged_master (Bitcoin PR #16841) 2020-11-27 21:29:55 +00:00
Andrew Poelstra
e10dd69c55 Merge a0e75bd31d into merged_master (Bitcoin PR #15937) 2020-11-27 20:39:27 +00:00
Andrew Poelstra
08378e5ad8 Merge 609ce2d0da into merged_master (Bitcoin PR #19644) 2020-11-27 18:05:45 +00:00
Andrew Poelstra
b65e321035 Merge 6757b3ac8f into merged_master (Bitcoin PR #19655) 2020-11-27 17:35:58 +00:00
Andrew Poelstra
e3ce21f597 Merge 8a85377cd0 into merged_master (Bitcoin PR #18654) 2020-11-27 17:12:56 +00:00
Andrew Poelstra
419fd4f90d Merge b75f2ad72d into merged_master (Bitcoin PR #19660) 2020-11-27 04:05:36 +00:00
Andrew Poelstra
d427e80d48 Merge bb2a9f9c8c into merged_master (Bitcoin PR #19634) 2020-11-27 00:46:50 +00:00
Andrew Poelstra
74108c6a87 Merge 4db44acf2d into merged_master (Bitcoin PR #18202)
What a pain. Again, not naming names, but it was Sjors again.
2020-11-26 01:46:05 +00:00
Andrew Poelstra
c2e804e75b Merge 32302e5c88 into merged_master (Bitcoin PR #19490) 2020-11-26 01:09:24 +00:00
Andrew Poelstra
8e770d3f21 Merge 915ac8a861 into merged_master (Bitcoin PR #19413) 2020-11-26 01:09:19 +00:00
Andrew Poelstra
9ac0c98505 Merge 7173a3c73b into merged_master (Bitcoin PR #19396) 2020-11-26 01:09:18 +00:00
Andrew Poelstra
473dea4c7b Merge 01f857a1c9 into merged_master (Bitcoin PR #19428) 2020-11-26 01:09:17 +00:00
Andrew Poelstra
dc44b27189 Merge d3a5dbfd1f into merged_master (Bitcoin PR #19114) 2020-11-26 01:09:14 +00:00
Andrew Poelstra
a2b426f3f9 Merge f32f7e907a into merged_master (Bitcoin PR #11413) 2020-11-26 01:09:13 +00:00
Andrew Poelstra
b431cfa2d7 Merge 532b134cb0 into merged_master (Bitcoin PR #19373) 2020-11-26 01:09:12 +00:00
Andrew Poelstra
31f5cfcef7 Merge 02b26ba1c1 into merged_master (Bitcoin PR #19200) 2020-11-26 01:09:10 +00:00
Andrew Poelstra
8dcff8b5c8 Merge 6bb5f6d8e3 into merged_master (Bitcoin PR #16377)
Note that this is a breaking change in Core's RPC -- if you add pegins
to createfundedpsbt then it won't do coin selection unless you provide
the additional new add_inputs option.
2020-11-26 01:09:10 +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
315a27a38b Merge 879acc681a into merged_master (Bitcoin PR #19018) 2020-11-26 01:09:09 +00:00
Andrew Poelstra
0663613ea7 Merge eac65d99dd into merged_master (Bitcoin PR #19261) 2020-11-26 01:09:04 +00:00
Andrew Poelstra
47f2c8acfa Merge 19e919217e into merged_master (Bitcoin PR #19250) 2020-11-26 01:09:03 +00:00
Andrew Poelstra
fe4f10e301 Merge 7a24cca829 into merged_master (Bitcoin PR #19100) 2020-11-26 01:09:03 +00:00
Andrew Poelstra
067e1c3d95 Merge 0fc6ea216c into merged_master (Bitcoin PR #19096) 2020-11-26 01:08:59 +00:00
Andrew Poelstra
5dcf991eba Merge df303ceb65 into merged_master (Bitcoin PR #18787) 2020-11-26 01:08:49 +00:00
Andrew Poelstra
5800ec9196 Merge ccd85b57af into merged_master (Bitcoin PR #17681) 2020-11-26 01:08:48 +00:00
Andrew Poelstra
51965ad1e6 Merge 25ad2c623a into merged_master (Bitcoin PR #18740) 2020-11-26 01:08:47 +00:00
Andrew Poelstra
e3ffc21621 Merge 4dd2e5255a into merged_master (Bitcoin PR #18946) 2020-11-26 01:08:44 +00:00
Andrew Poelstra
947570a389 Merge 51825aea7f into merged_master (Bitcoin PR #18922) 2020-11-26 01:08:43 +00:00
Andrew Poelstra
c0617d43b4 Merge a33901cb6d into merged_master (Bitcoin PR #18814) 2020-11-26 01:08:42 +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
c0fda0cc05 Merge ddc0a600b3 into merged_master (Bitcoin PR #18617)
For reasons I do not really grok, this PR changes the timing behavior of the
functional tests to reliably expose a deadlock in the claimpegin RPC that has
existed since the 0.17 rebase.

The mechanism is: in `claimpegin` in src/wallet/rpcwallet.cpp:5873, we call
`AcceptToMemoryPoolWorker`. This requires cs_main to be locked, which it is
not (contrast Core's `testmempoolaccept` RPC, which similarly calls
`AcceptToMemoryPoolWorker` from the RPC thread, and locks cs_main immediately
before).

We do *say* that it is locked, in the `LockAssertion` one the line above, but
this was added in ad3d496d78 during the 0.17
rebase (PR #620), apparently to shut up some linter on OSX, and as near as I
can tell it was never true.

Anyway, `AcceptToMemoryPoolWorker` calls through a couple layers which assume
cs_main is locked, to `AcceptSingleTransaction`, which locks m_pool.cs on line
src/validation.cpp:1101. It then calls `PreChecks`, which on line 784 calls
::ChainActive(), which _actually_ locks cs_main, though only briefly. This
line is the deadlock, because we locked m_pool.cs followed by cs_main...

...meanwhile, in src/net_processing.cpp, we lock cs_main at the top of the
`PeerLogicValidation::SendMessages` loop (src/net_processing.cpp:3628). In the
same loop, in the `feefilter` message processing, we call CTxMemPool::GetMinFee
(src/net_processing.cpp:4137), which locks m_pool.cs. Deadlock.

Anyway, that explains the change to locking behavior that I added to an
otherwise test-only PR.
2020-11-26 01:08:36 +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
873db53fe3 Merge 3be119c0f6 into merged_master (Bitcoin PR #17579) 2020-11-26 01:08:26 +00:00
Andrew Poelstra
569c68a0f2 Merge f8102d9088 into merged_master (Bitcoin PR #18601) 2020-11-26 01:08:25 +00:00