Commit graph

1408 commits

Author SHA1 Message Date
Andrew Chow
00fe59fd43 Rename CoinSelectionParams::effective_fee to m_effective_feerate
It's a feerate, not a fee. Also follow the style guide for member names.

Github-Pull: #21083
Rebased-From: f9cd2bfbcc
(cherry picked from commit d61fb07da7)
2021-09-22 02:05:02 +00:00
Andrew Chow
f897fd9575 wallet: Move discard feerate fetching to CreateTransaction
Instead of fetching the discard feerate for each SelectCoinsMinConf
iteration, fetch and cache it once during CreateTransaction so that it
is shared for each SelectCoinsMinConf through
coin_selection_params.m_discard_feerate.

Does not change behavior.

Github-Pull: #21083
Rebased-From: bdd0c2934b
(cherry picked from commit 5fc381e443)
2021-09-22 02:05:02 +00:00
Andrew Chow
300372f8bf wallet: Move long term feerate setting to CreateTransaction
Instead of setting the long term feerate for each SelectCoinsMinConf
iteration, set it once during CreateTransaction and let it be shared
with each SelectCoinsMinConf through
coin_selection_params.m_long_term_feerate.

Does not change behavior.

Github-Pull: #21083
Rebased-From: 448d04b931
(cherry picked from commit bcd716670b)
2021-09-22 02:05:02 +00:00
Andrew Chow
1f58b91c48 wallet: Replace nFeeRateNeeded with effective_fee
Make sure that all fee calculations use the same feerate.
coin_selection_params.effective_fee is the variable we use for all fee
calculations, so get rid of remaining nFeeRateNeeded usages and just
directly set coin_selection_params.effective_fee.

Does not change behavior.

Github-Pull: #21083
Rebased-From: e2f429e6bb
(cherry picked from commit 34c89f92f3)
2021-09-22 02:05:02 +00:00
Andrew Chow
12a25655e8 wallet: Use existing feerate instead of getting a new one
During each loop of CreateTransaction, instead of constantly getting a
new feerate, use the feerate that we have already fetched for all
fee calculations. Thix fixes a race condition where the feerate required
changes during each iteration of the loop.

This commit changes behavior as the "Fee estimation failed" error will
now take priority over "Signing transaction failed".

Github-Pull: #21083
Rebased-From: 1a6a0b0dfb
(cherry picked from commit 48fc675163)
2021-09-22 02:05:02 +00:00
Andrew Poelstra
c6f801d4ce PSET: encapsulate blind proof checks into one method 2021-09-21 20:33:31 +00:00
Andrew Poelstra
c88eb96e74 pset: check that we can get the blinding factors from any IsMine outputs before signing
Arguably we should do this for signrawtransaction too but it'd be a
lot of duplicated code for a deprecated workflow.
2021-09-21 20:33:31 +00:00
Andrew Poelstra
9c55d0a175 pset: only check asset/amount proofs in case both explicit+blinded values are provided 2021-09-21 20:33:28 +00:00
Andrew Poelstra
ade32378c1
Merge ElementsProject/elements#1041: re-enable fallbackfee by default
1204b91c2d re-enable fallbackfee by default (Andrew Poelstra)

Pull request description:

  Upstream disabled the default `fallbackfee` option in 0.17, which caused us some user error reports in 0.18. Re-enable the option in 0.21.

ACKs for top commit:
  stevenroose:
    utACK 1204b91c2d

Tree-SHA512: 62d053405c00f5ca31ae3fb24ab8def2c9e3bd52909dfac57e65224947295a56f0b8a322ffeb0dfcdcb3103fcaf310a9554f3ed3a8490859ca82aaeae26c7fb2
2021-09-16 23:51:19 +00:00
Andrew Poelstra
388d47f9a3
Merge ElementsProject/elements#1010: Support supplying contract hash to issueasset RPC
47d43f14ad Support supplying contract hash to issueasset RPC (Steven Roose)

Pull request description:

  forward port of https://github.com/ElementsProject/elements/pull/993.
  Closes https://github.com/ElementsProject/elements/issues/985.

ACKs for top commit:
  apoelstra:
    ACK 47d43f14ad

Tree-SHA512: e29cda86291c8fe4650595129af477c6dc8648465a5305002ae521bac21a114d6a1c44738786351ac4355eafdcb0da3e4e42c8f204137f9e31e03df20a91db64
2021-09-16 23:06:23 +00:00
Andrew Poelstra
1204b91c2d re-enable fallbackfee by default 2021-09-15 22:39:33 +00:00
Steven Roose
47d43f14ad
Support supplying contract hash to issueasset RPC 2021-09-15 16:23:32 -01:00
Andrew Chow
b2a7007961 pset: verify blind value and asset proofs when signing 2021-09-11 21:02:26 -04:00
Andrew Poelstra
2ec356a185 wallet: additional patch for https://github.com/bitcoin/bitcoin/issues/20347
How to review this PR:
  * Skim the description of https://github.com/bitcoin/bitcoin/issues/20347
    to see that it's roughly "when pick_new_inputs is unset but bnb_used is
    set, one the next iteration of the loop an assumption may be wrong"
  * See that in this case, we just add another iteration to the loop...
  * ...in exactly the same way as the other place that pick_new_inputs is
    turned off, I just missed this one before
  * Observe that the regression test fails before the patch but passes after.
2021-09-06 20:06:48 +00:00
Andrew Chow
25df8aa12b Fixes to FillPSBT 2021-06-22 14:42:19 -04:00
Andrew Chow
e6cc0fd693 Have walletprocesspsbt blind before signing 2021-06-22 14:42:19 -04:00
Andrew Chow
bad1876e03 Re-enable and fix PSBT signing 2021-06-22 14:42:19 -04:00
Andrew Chow
3f6c8bfda1 Add walletblindpsbt rpc 2021-06-22 14:42:19 -04:00
Andrew Chow
16395c15e9 Update wallet for PSBTv2 2021-06-22 13:54:50 -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
68bfd70b43 ci: various linter / CI compiler error fixes
Includes changing TRUE to OP_TRUE for anyone-can-spend output name,
to avoid symbol conflict on win64 builds, which is really obnoxious.
2021-03-26 17:33:04 +00:00
Andrew Poelstra
5b89a9fc92 Merge 80e32e120e into merged_master (Bitcoin PR #20305) 2020-12-02 17:53:59 +00:00
Andrew Poelstra
94f7b7ba64 Merge c463f70fb0 into merged_master (Bitcoin PR #20139) 2020-12-02 16:13:18 +00:00
Andrew Poelstra
29c7f63764 Merge c48e788246 into merged_master (Bitcoin PR #18836) 2020-12-02 15:51:02 +00:00
Andrew Poelstra
ff7aedd1dd Merge 543693b92b into merged_master (Bitcoin PR #20378) 2020-12-02 14:34:42 +00:00
Andrew Poelstra
e198740eb1 Merge d9f5132736 into merged_master (Bitcoin PR #20344) 2020-12-02 07:51:12 +00:00
Andrew Poelstra
7ec1f12f7c Merge 1dfe19e284 into merged_master (Bitcoin PR #20153) 2020-12-02 06:52:54 +00:00
Andrew Poelstra
2d1adacaf2 Merge 663fd92b28 into merged_master (Bitcoin PR #20266) 2020-12-02 06:16:37 +00:00
Andrew Poelstra
6a6ed8d6f1 Merge 26d7941224 into merged_master (Bitcoin PR #20230) 2020-12-01 21:22:22 +00:00
Andrew Poelstra
4eeadb7fde Merge 8ed37f6c84 into merged_master (Bitcoin PR #19077) 2020-11-30 20:20:56 +00:00
Andrew Poelstra
6a979f902a Merge 9efa55c715 into merged_master (Bitcoin PR #20130) 2020-11-30 18:50:04 +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
07d50b2951 Merge c95784e3d3 into merged_master (Bitcoin PR #20016) 2020-11-29 22:31:43 +00:00
Andrew Poelstra
7a8f77d7ad Merge 9e217f5a6f into merged_master (Bitcoin PR #19572) 2020-11-29 19:44:31 +00:00
Andrew Poelstra
9c308f094f Merge be375b2206 into merged_master (Bitcoin PR #19919) 2020-11-29 03:17:26 +00:00
Andrew Poelstra
239cea1d22 Merge 78cb45d722 into merged_master (Bitcoin PR #19738) 2020-11-29 00:26:50 +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
5f6eb8ee3f Merge f98872f127 into merged_master (Bitcoin PR #18244) 2020-11-28 18:55:44 +00:00
Andrew Poelstra
a6e69db203 Merge 7721b31809 into merged_master (Bitcoin PR #19773) 2020-11-28 18:22:47 +00:00
Andrew Poelstra
4087c88a7e Merge 269a7ccb27 into merged_master (Bitcoin PR #19099) 2020-11-28 17:53:38 +00:00
Andrew Poelstra
2217632a3e Merge 21eda43cde into merged_master (Bitcoin PR #19828) 2020-11-28 17:02:25 +00:00
Andrew Poelstra
de97906fad Merge 91af7ef831 into merged_master (Bitcoin PR #19289) 2020-11-28 14:31:34 +00:00
Andrew Poelstra
ddd9b819bb Merge a2a250c7d0 into merged_master (Bitcoin PR #19743) 2020-11-28 00:53:18 +00:00
Andrew Poelstra
f197c02e18 Merge c831e105c5 into merged_master (Bitcoin PR #14582) 2020-11-27 23:36:05 +00:00
Andrew Poelstra
229e81e10c Merge f269165edc into merged_master (Bitcoin PR #17458) 2020-11-27 20:32:05 +00:00
Andrew Poelstra
f3a6693ff5 Merge c0b1706964 into merged_master (Bitcoin PR #19568)
Reduction in duplicated code -and- in Elements/Bitcoin diff :)
2020-11-27 18:54:38 +00:00
Andrew Poelstra
7297f932a0 Merge 9d4b3d86b6 into merged_master (Bitcoin PR #19334) 2020-11-26 17:07:31 +00:00