Commit graph

4224 commits

Author SHA1 Message Date
Hennadii Stepanov
cc323e0d95 wallet: Postpone NotifyWalletLoaded() for encrypted wallets
Too early NotifyWalletLoaded() call in CWallet::Create() results the
notification goes before DescriptorScriptPubKeyMans were created and
added to an encrypted wallet.

Co-authored-by: Andrew Chow <achow101-github@achow101.com>

Github-Pull: bitcoin/bitcoin#24711
Rebased-From: 0c12f0116c
2025-03-10 15:36:55 +00:00
Hennadii Stepanov
92a518c4f3 wallet, refactor: Add wallet::NotifyWalletLoaded() function
This change is a prerequisite for the following bugfix.

Github-Pull: bitcoin/bitcoin#24711
Rebased-From: aeee419c6a
2025-03-10 15:36:42 +00:00
Pablo Greco
59c30c0779 Blinding: update change_position after calling fillBlindDetails 2025-02-25 14:57:10 -08:00
Byron Hambly
8dabb73663
moneyrange: check asset type 2025-01-17 13:09:10 +02:00
Byron Hambly
a3e0ce2e8c
amountfromvalue: add arg to check moneyrange 2025-01-17 13:09:10 +02:00
Byron Hambly
c1bc7caff5
fix: size estimation for pegin transactions 2024-08-14 15:41:29 +02:00
Byron Hambly
52962c16c9
discount: allow wallet to create discount txs 2024-05-14 19:03:37 +02:00
Pablo Greco
33a15604e8 getpeginaddress cannot be trusted during ibd, it should fail 2024-04-18 17:41:51 -07:00
Pablo Greco
d66c283f06 Remove constrains on liquidv1 pegout bitcoin descriptor 2023-11-22 09:57:12 -08:00
Pablo Greco
20c5630f8c
Merge pull request #1277 from delta1/issues-1259
fix: assert failure on non-policy asset consolidation in CreateTransactionInternal
2023-10-27 12:38:05 -03:00
James Dorfman
39be0f0925 wallet: fix tx credit calculation issues introduced in merge of bitcoin/bitcoin#22100 in 3e939cca and 103069c4 2023-10-27 15:23:19 +00:00
James Dorfman
04cba29faf coinselection: fail KnapsackSolver if the policy asset doesn't have a solution 2023-10-23 15:55:03 +00:00
James Dorfman
5b72ae23af
coinselection: fail if each non-policy asset doesn't have a solution 2023-10-23 16:51:09 +02:00
goatpig
2e7125c3c8
fix: assert failure on non-policy asset consolidation in CreateTransactionInternal
Squash of 2 commits from https://github.com/ElementsProject/elements/pull/1258

- correct application of non_policy_effective_value to policy output in KnapsackSolver
- replace bad fee amount assert with error log and graceful failure in CWallet::CreateTransactionInternal

(cherry picked from commit 0f92a38254)

Update src/wallet/coinselection.cpp

Co-authored-by: Byron Hambly <byron@hambly.dev>
(cherry picked from commit cf0f56107b)
2023-10-18 16:30:41 +02:00
Byron Hambly
5326676ff3
fix: segfault on getpeginaddress rpc when not in elements mode
Fixes https://github.com/ElementsProject/elements/issues/1263

When not running in Elements mode, GetValidFedpegScripts returns an
empty vector. Subsequently `calculate_contract` is called with
`fedpegscripts.front().second` which is a null reference. This reference
is passed into `MatchLiquidWatchman` which tries to dereference the null
reference and causes a segfault.

This fix throws an exception in `getpeginaddress` if fedpegscripts is
empty, returning an error to the RPC caller. It also adds a functional
regression test.
2023-10-18 13:02:51 +02:00
Byron Hambly
99ed6e1bee msvc secp modules 2023-10-09 21:17:40 +00:00
Byron Hambly
0c2fbefe98 add missing 'complete' bool to psbt_updater_test 2023-10-09 21:17:00 +00:00
Byron Hambly
3eaccae830
lint: fix codespell warnings 2023-09-27 15:56:20 +02:00
James Dorfman
0497d1f894 build: fix additional ASAN issues in CI 2023-09-07 05:07:50 +00:00
James Dorfman
8783a30631
build: fix further ASAN issues in CI 2023-09-06 15:03:51 +02:00
Byron Hambly
860b2c3e4b
fix: move BlindDetails and IssuanceDetails to wallet.h
resolves the newly introduced circular dependencies correctly
2023-09-05 14:38:03 +02:00
Byron Hambly
4671addbe0
build: fix forward declaration of CRecipient 2023-09-01 18:13:19 +02:00
Pablo Greco
3dfd7a4e9f Linter fixes 2023-08-31 14:47:07 -07:00
James Dorfman
d457ef7dbe Merge 6802564be5 into merged_master (Elements PR #1246) 2023-08-29 04:21:31 +00:00
Byron Hambly
b958e586ef
Fix for calling GetAmount on potentially blinded output
Introduced in 103069c46c
for Bitcoin PR bitcoin/bitcoin#22100
2023-08-08 14:11:12 +02:00
James Dorfman
6a42ca5f74 Remove unused mapValueFromPresetInputs variable from src/wallet/spend.cpp.
This variable was rendered unused in the merge of bitcoin/bitcoin#22019 in e3ab195851.
2023-07-24 17:50:33 +00:00
Byron Hambly
49c3ea309e
fix: getnewaddress - don't blind bech32 addresses
fixes #1245
2023-07-19 12:40:22 +02:00
Byron Hambly
7a7253639a Merge 267917f563 into merged_master (Bitcoin PR bitcoin/bitcoin#23304) 2023-07-03 10:06:51 +00:00
Byron Hambly
7e989c64b3 Merge 159f89c118 into merged_master (Bitcoin PR bitcoin/bitcoin#24365) 2023-07-02 17:03:39 +00:00
Byron Hambly
4fbfb0ccbe Merge 8d6f9210d9 into merged_master (Bitcoin PR bitcoin/bitcoin#24401) 2023-07-02 15:10:19 +00:00
Byron Hambly
0e89b30f95 Merge 8add59d77d into merged_master (Bitcoin PR bitcoin/bitcoin#24367) 2023-07-02 07:33:56 +00:00
Byron Hambly
cde0f7744b Merge 4acf2332d4 into merged_master (Bitcoin PR bitcoin/bitcoin#24376) 2023-07-01 07:47:21 +00:00
Byron Hambly
eb78939513 Merge b304b65782 into merged_master (Bitcoin PR bitcoin/bitcoin#24359) 2023-06-30 17:50:25 +00:00
Byron Hambly
db3167a06b Merge 2d7ea201fc into merged_master (Bitcoin PR bitcoin/bitcoin#24307) 2023-06-30 12:57:14 +00:00
Byron Hambly
04cea6bf40 Merge 8c0f02c69d into merged_master (Bitcoin PR bitcoin/bitcoin#24265) 2023-06-30 11:33:00 +00:00
Byron Hambly
85c276279a Merge 1e7564eca8 into merged_master (Bitcoin PR bitcoin/bitcoin#24251) 2023-06-30 09:07:50 +00:00
Byron Hambly
4988afcbc2 Merge 3ace3a17c9 into merged_master (Bitcoin PR bitcoin/bitcoin#20744) 2023-06-30 07:38:29 +00:00
Byron Hambly
999b6ac80b Merge 02e1d8d06f into merged_master (Bitcoin PR bitcoin/bitcoin#24083) 2023-06-30 06:11:44 +00:00
Byron Hambly
4e5e47d2d5 Merge 5f4c07b799 into merged_master (Bitcoin PR bitcoin/bitcoin#24136) 2023-06-29 13:43:18 +00:00
Byron Hambly
a992ccaac2 Merge 196b459920 into merged_master (Bitcoin PR bitcoin/bitcoin#23438) 2023-06-29 08:37:35 +00:00
Byron Hambly
063acc7793 Merge cf5bb048e8 into merged_master (Bitcoin PR bitcoin/bitcoin#22932) 2023-06-28 17:12:24 +00:00
Byron Hambly
ccd7b72d79 Merge e30b6ea194 into merged_master (Bitcoin PR bitcoin/bitcoin#24067) 2023-06-28 14:48:32 +00:00
Byron Hambly
7d759da52a Merge b94d0c7af1 into merged_master (Bitcoin PR bitcoin/bitcoin#23201)
This merge was a bit tricky, since in Elements the witnesses are not
part of the transaction inputs themselves. This merge should be reviewed
carefully.
2023-06-28 14:15:53 +00:00
Byron Hambly
8cc06b0c02 Merge a541e5d519 into merged_master (Bitcoin PR bitcoin/bitcoin#24104) 2023-06-20 12:23:08 +00:00
Byron Hambly
7878ba47b9 Merge c561f2f06e into merged_master (Bitcoin PR bitcoin/bitcoin#23497) 2023-06-19 09:28:31 +00:00
James Dorfman
81119e6161 Merge fa74718414 into merged_master (Bitcoin PR bitcoin/bitcoin#24026) 2023-06-15 20:36:05 +00:00
James Dorfman
b016786156 Merge 80ceede7a0 into merged_master (Bitcoin PR bitcoin/bitcoin#23884) 2023-06-15 20:23:35 +00:00
Byron Hambly
78a8032c1e Merge 4ada74206a into merged_master (Bitcoin PR bitcoin/bitcoin#23974) 2023-06-15 13:21:10 +00:00
Byron Hambly
13bb540284 Merge 801aaac2b3 into merged_master (Bitcoin PR bitcoin/bitcoin#23834) 2023-06-15 09:35:17 +00:00
Byron Hambly
47626b5a64 Merge 623745ca74 into merged_master (Bitcoin PR bitcoin/bitcoin#23912) 2023-06-14 15:44:11 +00:00