Commit Graph

22700 Commits

Author SHA1 Message Date
MarcoFalke
39b82fb541 Merge #16095: Catch by reference not value in wallettool
ae7faf20d5 Exceptions should be caught by reference, not by value. (Kristaps Kaupe)

Pull request description:

  Fixes this warning with GCC8/GCC9:
  ```
  wallet/wallettool.cpp: In function ‘std::shared_ptr<CWallet> WalletTool::LoadWallet(const string&, const boost::filesystem::path&)’:
  wallet/wallettool.cpp:62:25: warning: catching polymorphic type ‘const class std::runtime_error’ by value [-Wcatch-value=]
       } catch (const std::runtime_error) {
                           ^~~~~~~~~~~~~
  ```
  Related to #15822.

ACKs for commit ae7faf:
  practicalswift:
    utACK ae7faf20d5fb3e2415ccadc37100dfc44aa0cd94

Tree-SHA512: 07eb774b3296c0b66ac5040269bff6cd8ba0294c8c95cc08c595efbd535260ff0010fa430ca057eeccd7b38c0a981a3d7a95b675d9e2996853c013dc0bfe8127
2023-02-10 23:34:57 +03:00
Konstantin Akimov
9ab8acaf2d Merge #15660: [qa] Overhaul p2p_compactblocks.py
7813eb1db1 [qa] Overhaul p2p_compactblocks.py (Suhas Daftuar)

+ extra fixes for pull request #1966 (compact blocks)

Pull request description:

  Remove tests of:
   - compactblock behavior in a simulated pre-segwit version of bitcoind
     This should have been removed a long time ago, as it is not generally
     necessary for us to test the behavior of old nodes (except perhaps if we
     want to test that upgrading from an old node to a new one behaves properly)

   - compactblock behavior during segwit upgrade (ie verifying that network
     behavior before and after activation was as expected)
     This is unnecessary to test now that segwit activation has already happened.

ACKs for commit 7813eb:
  jnewbery:
    utACK 7813eb1db132c023902ad945995cc32a325893ca

Tree-SHA512: cadf035e6f822fa8cff974ed0c2e88a1d4d7da559b341e574e785fd3d309cc2c98c63bc05479265dc00550ae7b77fc3cbe815caae7f68bcff13a04367dca9b52
2023-02-10 23:34:57 +03:00
MarcoFalke
d15c58f1df Merge #15238: [QA] remove some magic mining constants in functional tests
b651ef7e1c submitheader: more directly test missing prev block header (Gregory Sanders)
1e7f741745 remove some magic mining constants in functional tests (Gregory Sanders)

Pull request description:

  The fewer magic numbers the better.

  Also more directly tested a `submitheader` case of bad previous blockhash.

Tree-SHA512: 52b01a6aa199fa909eea4e9e84409a901933e545724e33149cc4132c82168199fd678809b6d94d95c9ff6ad02238a9552363620d13b8beaa5d4b67ade9ef425c
2023-02-10 23:34:57 +03:00
Konstantin Akimov
206304d016 Merge bitcoin#14822: bench: Destroy wallet txs instead of leaking their memory 2023-02-10 23:34:57 +03:00
Konstantin Akimov
2919b9af4d Merge bitcoin#13815: util: Add [[nodiscard]] to all {Decode,Parse}[...](...) functions returning bool 2023-02-10 23:34:57 +03:00
Odysseas Gabrielides
59db773eac
fix: Dmnstate unserialize fix (#5192)
## Issue being fixed or feature implemented

## What was done?
Currently, `CDeterministicMNStateDiff` is unserialized incorrectly when
the bit of `Field_pubKeyOperator` is on.
Why? Because it attempts to read all other fields as
`CBLSLazyPublicKey`.

`if (obj.fields & Field_pubKeyOperator) {\ // ---> This check is always
true for all the fields

READWRITE(CBLSLazyPublicKeyVersionWrapper(const_cast<CBLSLazyPublicKey&>(obj.state.pubKeyOperator),
true)); \
        }`

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-10 12:34:33 -06:00
Konstantin Akimov
f26c479e23
fix: using checkMalleable in serialization of CBLSSignatureVersionWrapper (#5189)
## Issue being fixed or feature implemented
This changes are required, because constructor
`CBLSSignatureVersionWrapper` doesn't work as expected.
You may pass `checkMalleable = false` in constructor, but it will be
used `true` as default argument anyway


## What was done?
- fixed using flag `checkMalleable` in `CBLSSignatureVersionWrapper`
- removed unused `checkMalleable` in `ConstCBLSPublicKeyVersionWrapper`
- fixed order initialization in constructor (eliminate clang warning)
- re-ordered class members to reduce memory usage



## How Has This Been Tested?
Run functional/unit tests

## Breaking Changes
It changes API behavior but does it break anything?


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone
2023-02-10 14:14:57 +02:00
UdjinM6
2b702f8e84
fix/tests: fix masternode payments rpc, add tests (#5191)
## Issue being fixed or feature implemented
it was picking the wrong DMN as a payee...

## What was done?
see code and notes

## How Has This Been Tested?
run tests

## Breaking Changes
n/a


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-10 13:21:05 +02:00
UdjinM6
f12983cce7
fix(qt): Ignore change output in reassignAmounts (#5182)
## Issue being fixed or feature implemented
#5180 

## What was done?
`reassignAmounts` was behaving incorrectly when change and recipient
address were the same. Ignore change output should fix it.

## How Has This Been Tested?
To reproduce #5180: create a tx which sends to some address but has a
custom change address set to the very same address too (enable "custom
change address" checkbox and paste an address there), make sure the
"subtract fee from amount" checkbox is enabled. The problem should go
away when the patch is applied.

## Breaking Changes
none

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [ ] I have assigned this pull request to a milestone
2023-02-09 03:19:49 +03:00
Konstantin Akimov
d07678c5ae
fix: using BLSDKG_GenerateContributions in benchmark (#5188)
## Issue being fixed or feature implemented
BLSDKG_InitDKG used twice. Instead, once should be used
BLSDKG_GenerateContributions



## What was done?
Replaced BLSDKG_InitDKG to BLSDKG_GenerateContributions


## How Has This Been Tested?
With patch (completely other numbers for
`BLSDKG_GenerateContributions`):
```
|       12,400,083.80 |               80.64 |   22.4% |      0.14 | 〰️ `BLSDKG_GenerateContributions_simple_10` (Unstable with ~54.3 iters. Increase `minEpochIterations` to e.g. 543)
|       72,281,069.33 |               13.83 |    1.5% |      0.81 | `BLSDKG_GenerateContributions_simple_50`
|       36,100,161.96 |               27.70 |    2.5% |      0.40 | `BLSDKG_InitDKG_simple_10`
|      124,084,124.30 |                8.06 |    1.9% |      1.35 | `BLSDKG_InitDKG_simple_50`
```
Without patch (same number for InitDKG and GenerateContributions):
```
|       36,636,218.34 |               27.30 |    0.9% |      0.41 | `BLSDKG_GenerateContributions_simple_10`
|      124,856,040.60 |                8.01 |    2.8% |      1.37 | `BLSDKG_GenerateContributions_simple_50`
|       36,886,990.17 |               27.11 |    1.2% |      0.40 | `BLSDKG_InitDKG_simple_10`
|      120,018,476.30 |                8.33 |    2.5% |      1.30 | `BLSDKG_InitDKG_simple_50`
```

## Breaking Changes
no breaking changes


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone
2023-02-08 14:48:26 -06:00
Odysseas Gabrielides
97d94520d0
refactor: remove protx_update_service_legacy (#5185)
<!--
*** Please remove the following help text before submitting: ***

Provide a general summary of your changes in the Title above

Pull requests without a rationale and clear improvement may be closed
immediately.

Please provide clear motivation for your patch and explain how it
improves
Dash Core user experience or Dash Core developer experience
significantly:

* Any test improvements or new tests that improve coverage are always
welcome.
* All other changes should have accompanying unit tests (see
`src/test/`) or
functional tests (see `test/`). Contributors should note which tests
cover
modified code. If no tests exist for a region of modified code, new
tests
  should accompany the change.
* Bug fixes are most welcome when they come with steps to reproduce or
an
explanation of the potential issue as well as reasoning for the way the
bug
  was fixed.
* Features are welcome, but might be rejected due to design or scope
issues.
If a feature is based on a lot of dependencies, contributors should
first
  consider building the system outside of Dash Core, if possible.
-->

## Issue being fixed or feature implemented
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
Removed RPC `protx update_service_legacy` since this RPC parses BLS
private key (instead of BLS public key).
BLS scheme do not affect private keys, contrary to public keys.

## What was done?
<!--- Describe your changes in detail -->


## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->


## Breaking Changes
<!--- Please describe any breaking changes your code introduces -->


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-07 19:33:40 +02:00
Odysseas Gabrielides
ce51386f9f
fix: added missing specific_legacy_bls_scheme (#5184)
<!--
*** Please remove the following help text before submitting: ***

Provide a general summary of your changes in the Title above

Pull requests without a rationale and clear improvement may be closed
immediately.

Please provide clear motivation for your patch and explain how it
improves
Dash Core user experience or Dash Core developer experience
significantly:

* Any test improvements or new tests that improve coverage are always
welcome.
* All other changes should have accompanying unit tests (see
`src/test/`) or
functional tests (see `test/`). Contributors should note which tests
cover
modified code. If no tests exist for a region of modified code, new
tests
  should accompany the change.
* Bug fixes are most welcome when they come with steps to reproduce or
an
explanation of the potential issue as well as reasoning for the way the
bug
  was fixed.
* Features are welcome, but might be rejected due to design or scope
issues.
If a feature is based on a lot of dependencies, contributors should
first
  consider building the system outside of Dash Core, if possible.
-->
Passing the `specific_legacy_bls_scheme` flag when parsing BLS public
key was missing.
(Affected RPC was: `protx update_registrar_legacy`)

## Issue being fixed or feature implemented
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->


## What was done?
<!--- Describe your changes in detail -->


## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->


## Breaking Changes
<!--- Please describe any breaking changes your code introduces -->


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-07 19:33:13 +02:00
PastaPastaPasta
3f802035fd
Merge pull request #5072 from kittywhiskers/sqlite
backport: merge bitcoin#20130, #19077, #20156, #20216, #20308, #20324, #20202, #20275, #21634, #21540, #21962, #25378, #23112 (sqlite)
2023-02-07 10:54:05 -06:00
Kittywhiskers Van Gogh
ca962a6e42 merge bitcoin#23112: enable SQLite extended result codes 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
dc7ad45131 merge bitcoin#25378: sqlite 3380500 in depends 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
f3407ce3f3 merge bitcoin#21962: dedup sqlite PRAGMA access 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
b2d22d9b3f merge bitcoin#21540: refactor: dedup sqlite statement preparations/deletions 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
9795605d3b merge bitcoin#21634: Skip SQLite fsyncs while testing 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
6900545ca8 merge bitcoin#20275: List all wallets in non-SQLite and non-BDB builds 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
9c4f84efc5 merge bitcoin#20324: Set DatabaseStatus::SUCCESS in MakeSQLiteDatabase 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
7758b424f2 merge bitcoin#20308: Set bilingual error completely 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
1bec382e0b merge bitcoin#20216: fix buffer over-read in SQLite file magic check 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
a55cb7a635 merge bitcoin#20202: Make BDB support optional 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
4c7112b106 merge bitcoin#20156: Make sqlite support optional (compile-time) 2023-02-07 10:53:33 -06:00
UdjinM6
90c7f16596 build: Avoid fcntl64@GLIBC_2.28 in libsqlite3.a 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
f42288c984 partial bitcoin#19077: Add sqlite as an alternative wallet database and use it for new descriptor wallets 2023-02-07 10:53:33 -06:00
Kittywhiskers Van Gogh
0fa0991e6e merge bitcoin#20130: remove db mode string 2023-02-07 10:53:33 -06:00
Konstantin Akimov
e2224cbf8a
build: remove cmake from list of packages (#5179)
## Issue being fixed or feature implemented
Seems as `cmake` package is not needed anymore so far as `immer` moved
inside src/ directory.
`immer` is integrated to our Makefile.am and do not requires extra call
of cmake as it used to be.

## What was done?
Removed cmake from list of packages and removed package `cmake.mk`


## How Has This Been Tested?
Tested build with HEAD - succeed.
After that reverted to the old revision that have `immer` package
(85d6cadbfa).
Failed as expected:
```
make: *** No rule to make target 'cmake', needed by '/home/knst/projects/dash/depends/built/x86_64-pc-linux-gnu/bls-dash/bls-dash-1.2.0-6213882c069.tar.gz'.  Stop.
```


## Breaking Changes
No breaking changes


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-02-07 09:31:20 -06:00
Konstantin Akimov
197aa65f73
refactor: remove dependency of dummyWallet in RecoverDatabaseFile on NodeContext (#5178)
## Issue being fixed or feature implemented
Bitcoin#15639 removes libbitcoin-server library from list of wallet
linkage list.
It is not possible to remove this dependency in dash now because
coinjoin hardly used libbitcoin-server in client side.
Despite that, this dependency can be removed.

## What was done?
Removed NodeContext from dummyWallet by providing nullptr as a chain
pointer.


## How Has This Been Tested?
Validated, that linkage error "NodeContext is unknown symbol"
disappeared in case if remove libbitcoin-server dependency.

## Breaking Changes
No breaking changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone
2023-02-06 13:57:24 -06:00
Odysseas Gabrielides
c6bc33738b
docs: Release notes for BLS upgrade (#5137)
## Issue being fixed or feature implemented

## What was done?

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: thephez <thephez@users.noreply.github.com>
2023-02-06 09:02:53 -06:00
PastaPastaPasta
8362f9d639
Merge pull request #5170 from knst/bc-bp-psbt-1.9
backport:  bitcoin#17156, #17524, #16944, #16326, #14055, #13712 (psbt's related)
2023-02-04 10:03:04 -06:00
fanquake
63ed912c73 Merge #17156: psbt: check that various indexes and amounts are within bounds
deaa6dd144f5650b385658a0c4f9a014aff8dde2 psbt: check output index is within bounds before accessing (Andrew Chow)
f1ef7f0aa46338f4cd8de79696027a1bf868f359 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow)

Pull request description:

  Fixes #17149

  Two classes of issues were found by the psbt fuzzer: values out of range and causing overflows, and prevout indexes being out of range. This PR fixes both.

  When accessing a specific output using the index given in the tx, check that it is actually a possible output before trying to access the output.

  When summing and checking amounts for `decodepsbt` and `analyzepsbt`, make sure that the values are actually valid money values.. Otherwise, stop summing and don't show the fee. For `analyzepsbt`, return that the next role is the Creator since the Creator needs to remake the transaction to be valid.

ACKs for top commit:
  practicalswift:
    ACK deaa6dd144f5650b385658a0c4f9a014aff8dde2 -- only change since last ACK was the addition of tests
  gwillen:
    tested ACK deaa6dd, would also like to see this merged!

Tree-SHA512: 06c36720bbb5a7ab1c29f7d15878bf9f0d3e5760c06bff479d412e1bf07bb3e0e9ab6cca820a4bfedaab71bfd7af813807e87cbcdf0af25cc3f66a53a06dbcfd
2023-02-04 10:02:37 -06:00
MarcoFalke
bd0f27310f Merge #17524: psbt: handle unspendable psbts
773d4572a4864ab7b6380858d07d9579ff6dd9a2 Mark PSBTs spending unspendable outputs as invalid in analysis (Andrew Chow)
638e40cb6080800c7b0a7f4028f63326acbe4700 Have a PSBTAnalysis state that indicates invalid PSBT (Andrew Chow)

Pull request description:

  When analyzing an unspendable PSBT, report that it is unspendable and exit analysis early.

ACKs for top commit:
  Sjors:
    ACK 773d457
  instagibbs:
    After some thought ACK 773d4572a4

Tree-SHA512: 99b0cb2fa1ea37593fc65a20effe881639d69ddeeecf5197bc87bc7f2220cbeb40f1d429d517e4d27f2e9fb563a00cd845d2b4b1ce05246a75a6cb56fb9b0ba5
2023-02-04 10:02:37 -06:00
Samuel Dobson
a5d1e8d831 Merge #16944: gui: create PSBT with watch-only wallet
c6dd565c8820aa8a98b190621e10c6e2821a9ecc [gui] watch-only wallet: copy PSBT to clipboard (Sjors Provoost)
39465d545d521e66bb3accfa788aa94bffaf47eb [wallet] add fillPSBT to interface (Sjors Provoost)
848f88920853724511387ca0b7ef652fa14ced71 [gui] send: include watch-only (Sjors Provoost)
40537f090907f81ba885edb7dff1558382976912 [wallet] ListCoins: include watch-only for wallets without private keys (Sjors Provoost)

Pull request description:

  For wallets with `WALLET_FLAG_DISABLE_PRIVATE_KEYS` this makes the watch-only balance available on the send screen (including coin selection). Instead of sending a transaction it generates a PSBT.

  The user can take this PSBT and process it with [HWI](https://github.com/bitcoin-core/HWI) or put it an SD card for hardware wallets that support that.

  The PSBT is copied to the clipboard. This was the easiest approach; we can add a dialog later to display it, as well as an option to save to disk.

ACKs for top commit:
  instagibbs:
    test and code review ACK c6dd565c88
  meshcollider:
    re-ACK c6dd565c8820aa8a98b190621e10c6e2821a9ecc

Tree-SHA512: ebc3da0737e33b255ed926191b84569aedb6097d14868662bd5dce726ce3048e86e9a31eba987b10dffe1482b35c21ae1cd595c2caa4634bc4cf78a826a83852
2023-02-04 10:02:37 -06:00
fanquake
940348388f Merge #16326: [RPC] add new utxoupdatepsbt arguments to the CRPCCommand and CPRCCvertParam tables
91cc18f602fe2ff7fe47335a8e1e7734895a19d9 [docs] Add release notes for PR 15427 (John Newbery)
3b11420b3c91f731b03805a39e48ee32e54484a2 [RPC] add new utxoupdatepsbt arguments to the CRPCCommand and CPRCConvertParam tables (John Newbery)

Pull request description:

  The new `descriptors` argument was not added to the CRPCCommand and CPRCCvertParam tables, meaning that it couldn't be used with bitcoin-cli or named arguments.

  Before this PR:

  ```
  > bitcoin-cli utxoupdatepsbt 'cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' "[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]"
  error code: -3
  error message:
  Expected type array, got string
  > bitcoin-cli --named utxoupdatepsbt psbt='cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' descriptors="[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]"
  error code: -8
  error message:
  Unknown named parameter descriptors
  ```

  After this PR:

  ```
  bitcoin-cli utxoupdatepsbt 'cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' "[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]"
  cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==
  bitcoin-cli --named utxoupdatepsbt psbt='cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==' descriptors="[{\"desc\":\"sh(wpkh([bd50871a/0h/0h/0h]03895c66337b38699bfafff1084ad35bc347fac4f4e5e5fe5eb7dd81155280db53))\"}]"
  cHNidP8BAFMCAAAAAYCdwVRx2X3o4KHx5tAMsN1ddp51MbfWsietjfMbl5HtAAAAAAD/////AQDh9QUAAAAAF6kUW+rtEOi4nk9rpw2F5XZl1dd8ehGHAAAAAAAAAA==
  ```

ACKs for top commit:
  promag:
    ACK 91cc18f.
  fanquake:
    re-ACK 91cc18f602fe2ff7fe47335a8e1e7734895a19d9

Tree-SHA512: 279b2339a5cac17e363002e4ab743e251d6757c904c89f1970575bdce18d4f63d5e13507e171bf2bdc1bf6dd457db345a4b11b15d4ff71b96c2fedc4ffe52b23
2023-02-04 10:02:37 -06:00
Konstantin Akimov
cd6de8000f Merge #14055: fix walletcreatefundedpsbt deriv paths, add test
61fe653 fix walletcreatefundedpsbt deriv paths, add test (Gregory Sanders)

Pull request description:

  Added the regression in #13968

Tree-SHA512: a31290b57ed80a8486925e562ca5412500d4215a238de7e448f48edfa671c87aebd79ee179a8340b289d9811ae6fa30ef75eefd5f5890fb6285174c5db72ff65
2023-02-04 10:02:37 -06:00
MarcoFalke
fa52d3bc12 Merge #13712: wallet: Fix non-determinism in ParseHDKeypath(...). Avoid using an uninitialized variable in path calculation.
27ee53c1ae wallet: Add error handling. Check return value of ParseUInt32(...) in ParseHDKeypath(...). (practicalswift)
7223263899 wallet: Add tests for ParseHDKeypath(...) (practicalswift)

Pull request description:

  Add error handling. Check return value of `ParseUInt32(...)` in `ParseHDKeypath(...)`.

  `ParseUInt32(...)` returns `false` if the entire string could not be parsed or when an overflow or underflow occurred. In such case the uninitialized variable `number` would be used in the calculation of `path` (prior to this commit).

  An example key path triggering this is `m/0/4294967296`:

  ```
    ParseHDKeypath("m/0/4294967296", keypath);
  ```

  `4294967296` is `1` + `0xFFFFFFFF` (`uint32_t` max: `4294967295`).

  Introduced in a4b06fb42eb0ad94e562ca839391b57e69285136 which was merged into `master` 14 hours ago as part of #13557 ("BIP 174 PSBT Serializations and RPCs").

Tree-SHA512: e5ff423f67c18d82c1231bde6343587a453e793c32004d93dc9b61be6d9372b57a6b2c9978d9eb1000d6cc82fd180f2486013f928dca737fb92daad22c16e467
2023-02-04 10:02:37 -06:00
PastaPastaPasta
6757616559
Merge pull request #5168 from kittywhiskers/p2pbp
backport: merge bitcoin#19053, #19174, #19293, #19704, #19472, #19583 (net_processing.{cpp|h} refactoring)
2023-02-03 16:24:40 -06:00
Kittywhiskers Van Gogh
383f902abf merge bitcoin#19583: clean up Misbehaving() 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
24546f93e5 merge bitcoin#19472: Reduce cs_main scope in MaybeDiscourageAndDisconnect() 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
4dd3ec2cb9 refactor: pass CNode reference as const when possible 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
99f6c314c0 refactor: rearrange argument order to be more consistent 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
a4e0327c29 refactor: pass CNode by reference for ProcessMessage functions 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
97d485159b refactor: rename ProcessSporkMessages to match other functions 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
260ef0a811 merge bitcoin#19704: move ProcessMessage() to PeerLogicValidation 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
af0dd17ca6 merge bitcoin#19293: Avoid redundant and confusing FAILED log 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
0b1a30afc1 merge bitcoin#19174: replace CConnman pointers by references in net_processing.cpp 2023-02-03 15:25:38 -06:00
Kittywhiskers Van Gogh
0385df1bc7 merge bitcoin#19053: replace CNode pointers by references within net_processing.{h,cpp} 2023-02-03 15:25:38 -06:00
Konstantin Akimov
90d888dc31
refactor: tidy up implementation of special tx manager (#5172)
## Issue being fixed or feature implemented
It is preparation work for #5026 (moved out a refactoring as a new pull
request)

## What was done?
 - tidy up header dependencies
 - move general code to proper headers


## How Has This Been Tested?
Run unit/functional tests

## Breaking Changes
No breaking changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
2023-02-02 23:22:51 -06:00
Konstantin Akimov
9a03334893
fix: keeping reference to local variable in Coin Join unit tests (#5174)
It become a visible UB (crash) after backport bitcoin#19848

## What was done?
Increased life-term for object under reference

## How Has This Been Tested?
Run unit/functional tests with and without bitcoin#19848

## Breaking Changes
No breaking changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have assigned this pull request to a milestone
2023-01-31 11:27:01 -06:00