Commit Graph

39848 Commits

Author SHA1 Message Date
fanquake
bde8d63b17
depends: build libmultiprocess with position independant code
This matches what we do with all other dependencies, see `--with-pic`,
and fixes build failures, like #26943.
2023-12-12 13:58:38 +00:00
fanquake
506634d79d
depends: always install libmultiprocess to /lib
On some systems, libmultiprocess would be installed into `lib64`, I
assume due to the use of GNUInstallDirs, however all other libs we build
in depends, go into lib/. Rather than adding lib64/ to the pkg-config
and link flags, I opted for always installing into lib/.

This was changed in
https://github.com/chaincodelabs/libmultiprocess/pull/79 upstream.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2023-12-12 13:58:38 +00:00
fanquake
beb3096263
depends: always install capnp to /lib
On some systems, capnp would be installed into `lib64`, I
assume due to the use of GNUInstallDirs, however all other libs we build
in depends, go into lib/. Rather than adding lib64/ to the pkg-config
and link flags, I opted for always installing into lib/.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2023-12-12 13:58:38 +00:00
fanquake
a7484be65f
Merge bitcoin/bitcoin#29059: Revert "ci: Only run functional tests on windows in master"
7b22cd80e0 Revert "ci: Only run functional tests on windows in master" (Hennadii Stepanov)

Pull request description:

  This PR reverts commit aba4a5887b from https://github.com/bitcoin/bitcoin/pull/28567.

  The Windows-specific code received [quality](https://github.com/bitcoin/bitcoin/pull/28486) and [performance](https://github.com/bitcoin/bitcoin/pull/29045) improvements recently. So there are no reasons to skip functional tests in PRs anymore.

  In my own repo, I've run the GHA Windows job more than 100 times with no failure.

ACKs for top commit:
  maflcko:
    lgtm ACK 7b22cd80e0
  TheCharlatan:
    ACK 7b22cd80e0

Tree-SHA512: 1e8687e8efe12db506e7cd2d5df9e48b5acb98a339f84684dd0fd67280e22227e2a5a206f1108b09e49038fab7a3ca2ffbd985677f00048c0962b39b2b9a2ba5
2023-12-12 13:43:06 +00:00
fanquake
60f677375e
Merge bitcoin/bitcoin#29055: tests, bench: Fix issue with CWallet::LoadWallet() being called in the wrong places
bd7f5d33e3 wallet: Assert that the wallet is not initialized in LoadWallet (Andrew Chow)
fb0b6ca4e5 tests, bench: Remove incorrect LoadWallet() calls (Andrew Chow)

Pull request description:

  `CWallet::LoadWallet()` expects to be called after a `CWallet` is constructed, but before any of its member functions called. Doing so invalidates pointers which causes issues with some PRs and branches that I am working on. This was being used incorrectly in a few tests and benchmarks, resulting in segfaults.

  As a precaution for this kind of issue in the future, I've also added a few asserts to `LoadWallet()` so that developers will notice when it is used incorrectly.

  As similar issue was fixed in #27666

ACKs for top commit:
  S3RK:
    ACK bd7f5d33e3
  furszy:
    ACK bd7f5d33

Tree-SHA512: 7664f12b8452994e7fc4d7d4f77697fb5f75edb0dba95ba99a4a23ec03d5b8e0ecbdcb7635547a0e8b4f89f708f98dcb5d039df0559e24b1ae411ed630e16e14
2023-12-12 11:47:34 +00:00
fanquake
7a283836eb
Merge bitcoin/bitcoin#29052: doc/reduce-traffic: update/clarify max outbound connection count
d58f89d355 doc: update/clarify max outbound connection count (Marnix)

Pull request description:

  closes https://github.com/bitcoin/bitcoin/issues/29046

ACKs for top commit:
  amitiuttarwar:
    ACK d58f89d355
  brunoerg:
    ACK d58f89d355

Tree-SHA512: 4f6e8596ceea0b655338b3fc90a465e319d81e2a006f22a98cd9acada9316e7eb2340e2f66b1b4dde4e63ae94f57efddec50478715608e1be3212b8e2d1c3a1a
2023-12-12 11:31:09 +00:00
fanquake
622e79e0fb
Merge bitcoin/bitcoin#29021: refactor: rpc: Pass CBlockIndex by reference instead of pointer
fa5989d514 refactor: rpc: Pass CBlockIndex by reference instead of pointer (MarcoFalke)
fa604eb6cf refactor: Use reference instead of pointer in IsBlockPruned (MarcoFalke)

Pull request description:

  Follow-up to https://github.com/bitcoin/bitcoin/pull/29003#issuecomment-1841435462

ACKs for top commit:
  TheCharlatan:
    ACK fa5989d514
  pablomartin4btc:
    tACK fa5989d514
  dergoegge:
    Code review ACK fa5989d514

Tree-SHA512: 7449de3e3bb435dcbf438df88df343bb70f6edc3228ee7c0078f912ffb415e951ba30f8ecad916765f8cf896f0d784fe30535c5cf997e303cf5af257ade69773
2023-12-12 10:47:04 +00:00
Hennadii Stepanov
7b22cd80e0
Revert "ci: Only run functional tests on windows in master"
This reverts commit aba4a5887b.
2023-12-12 10:04:49 +00:00
furszy
576bee88fd
fuzz: disable BnB when SFFO is enabled 2023-12-11 23:40:21 -03:00
furszy
05e5ff194c
test: add coverage for BnB-SFFO restriction
Verify the transaction creation process does not produce
a BnB solution when SFFO is enabled.
This is currently problematic because it could require a
change output. And BnB is specialized on changeless solutions.

Co-authored-by: Andrew Chow <achow101@gmail.com>
Co-authored-by: Murch <murch@murch.one>
2023-12-11 23:40:21 -03:00
Andrew Chow
bd7f5d33e3 wallet: Assert that the wallet is not initialized in LoadWallet
LoadWallet() cannot be run after the wallet has been initialized. So
assert that to avoid making this mistake in the future.
2023-12-11 17:03:25 -05:00
Andrew Chow
fb0b6ca4e5 tests, bench: Remove incorrect LoadWallet() calls
LoadWallet() must only be called immediately after a CWallet is
constructed, or not at all. Doing so after any other CWallet member
functions have been called may cause pointers and other objects
setup by other those functions to become invalidated.

Since these tests and benchmarks are using completely new wallets with
mock databases, it's not necessary to call LoadWallet() anyways, so
these can be dropped.
2023-12-11 17:03:25 -05:00
Kashif Smith
1757452cc5 test: Add tests for CFeeRate multiplication operator 2023-12-11 16:27:58 -05:00
Marnix
d58f89d355 doc: update/clarify max outbound connection count 2023-12-11 20:05:25 +01:00
Kashif Smith
98afe78661 doc: Update bitcoin-tx replaceable documentation 2023-12-11 13:08:46 -05:00
MarcoFalke
fa46cc22bc
Remove deprecated -rpcserialversion 2023-12-11 18:22:13 +01:00
Vasil Dimov
856c88776f ArgsManager: return path by value from GetBlocksDirPath()
`ArgsManager::m_cached_blocks_path` is protected by
`ArgsManager::cs_args` and returning a reference to it after releasing
the mutex is unsafe.

To resolve this, return a copy of the path. This has some performance
penalty which is presumably ok, given that paths are a few 100s bytes
at most and `GetBlocksDirPath()` is not called often.

This silences the following (clang 18):

```
common/args.cpp:288:31: error: returning variable 'm_cached_blocks_path' by reference requires holding mutex 'cs_args' [-Werror,-Wthread-safety-reference-return]
  288 |     if (!path.empty()) return path;
      |                               ^
```

Do the same with
`ArgsManager::GetDataDir()`,
`ArgsManager::GetDataDirBase()` and
`ArgsManager::GetDataDirNet()`.
2023-12-11 17:42:17 +01:00
MarcoFalke
fa3d9304e8
refactor: Remove pre-C++20 fs code
Treating std::string as UTF-8 is deprecated in std::filesystem::path
since C++20.

However, it makes this codebase easier to read and maintain to retain
the ability for std::string to hold UTF-8.
2023-12-11 17:42:17 +01:00
MarcoFalke
fa00098e1a
Add tests for C++20 std::u8string
Also, add missing includes:

 #include <system_error>  // for error_code
 #include <type_traits>   // for is_same

 #include <cerrno>        // for errno
2023-12-11 17:42:05 +01:00
MarcoFalke
fa2bac08c2
refactor: Avoid copy/move in fs.h
The operator accepts a const& reference, so no copy or move is needed.
See https://en.cppreference.com/w/cpp/filesystem/path/append
2023-12-11 17:41:54 +01:00
MarcoFalke
faea30227b
refactor: Use C++20 std::chrono::days 2023-12-11 17:41:39 +01:00
fanquake
d5e5810bd3
Merge bitcoin/bitcoin#28999: build: Enable -Wunreachable-code
fa8adbe7c1 build: Enable -Wunreachable-code (MarcoFalke)

Pull request description:

  It seems a bit confusing to write code after a `return`. This can even lead to bugs, or incorrect code, such as https://github.com/bitcoin/bitcoin/pull/28830/files#r1415372320 . (Edit: The linked instance is not found by clang's `-Wunreachable-code`).

  Fix all issues by enabling `-Wunreachable-code`.

  This flag also enables `-Wunreachable-code-loop-increment`, according to https://clang.llvm.org/docs/DiagnosticsReference.html#wunreachable-code, so remove that.

ACKs for top commit:
  ajtowns:
    > ACK [fa8adbe](fa8adbe7c1)
  stickies-v:
    ACK fa8adbe7c1
  jonatack:
    ACK fa8adbe7c1 tested with arm64 clang 17.0.6

Tree-SHA512: 12a2f74b69ae002e62ae08038f7458837090a12051a4c154d05ae4bb26fb19fc1fa76c63aedf2b3fbb36f048c593ca3b8c0efe03fe93cf07a0fd114fc84ce1e7
2023-12-11 15:44:16 +00:00
fanquake
dabd704642
Merge bitcoin/bitcoin#25273: wallet: Pass through transaction locktime and preset input sequences and scripts to CreateTransaction
0295b44c25 wallet: return CreatedTransactionResult from FundTransaction (Andrew Chow)
758501b713 wallet: use optional for change position as an optional in CreateTransaction (Andrew Chow)
2d39db7aa1 wallet: Explicitly preserve scriptSig and scriptWitness in CreateTransaction (Andrew Chow)
14e50746f6 wallet: Explicitly preserve transaction version in CreateTransaction (Andrew Chow)
0fefcbb776 wallet: Explicitly preserve transaction locktime in CreateTransaction (Andrew Chow)
4d335bb1e0 wallet: Set preset input sequence through coin control (Andrew Chow)
596642c5a9 wallet: Replace SelectExternal with SetTxOut (Andrew Chow)
5321786b9d coincontrol: Replace HasInputWeight with returning optional from Get (Andrew Chow)
e1abfb5b20 wallet: Introduce and use PreselectedInput class in CCoinControl (Andrew Chow)

Pull request description:

  Currently `FundTransaction` handles transaction locktime and preset input data by extracting the selected inputs and change output from `CreateTransaction`'s results. This means that `CreateTransaction` is actually unaware of any user desired locktime or sequence numbers. This can have an effect on whether and how anti-fee-sniping works.

  This PR makes `CreateTransaction` aware of the locktime and preset input data by providing them to `CCoinControl`. `CreateTransasction` will then set the sequences, scriptSigs, scriptWItnesses, and locktime as appropriate if they are specified. This allows `FundTransaction` to actually use `CreateTransaction`'s result directly instead of having to extract the parts of it that it wants.

  Additionally `FundTransaction` will return a `CreateTransactionResult` as `CreateTransaction` does instead of having several output parameters. Lastly, instead of using `-1` as a magic number for the change output position, the change position is changed to be an optional with no value set indicating no desired change output position (when provided as an input parameter) or no change output present (in the result).

ACKs for top commit:
  josibake:
    ACK 0295b44c25
  S3RK:
    Code review ACK 0295b44c25

Tree-SHA512: 016be4d41cbf97e1938506e70959bb5335b87006162a1c1c62fa0adb637cbe7aefb76d342b8efad5f37dc693f270c8d0a0839e239fd1ac32c6941a8172f1a710
2023-12-11 15:29:25 +00:00
fanquake
255004fc5e
Merge bitcoin/bitcoin#29009: fuzz: p2p: Detect peer deadlocks
9f265d8825 fuzz: Detect deadlocks in process_message (dergoegge)
fae1e7e012 fuzz: p2p: Detect peer deadlocks (MarcoFalke)

Pull request description:

  It may be possible that a peer connection will deadlock, due to software bugs such as https://github.com/bitcoin/bitcoin/pull/18808.

  Fix this by detecting them in the fuzz target.

  Can be tested by introducing a bug such as:

  ```diff
  diff --git a/src/net_processing.cpp b/src/net_processing.cpp
  index 1067341495..97495a13df 100644
  --- a/src/net_processing.cpp
  +++ b/src/net_processing.cpp
  @@ -2436,3 +2436,3 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic
       if (it != peer.m_getdata_requests.end() && !pfrom.fPauseSend) {
  -        const CInv &inv = *it++;
  +        const CInv& inv = *it;
           if (inv.IsGenBlkMsg()) {
  ```

  Using a fuzz input such as:

  ```
  $ base64 ./timeout-ada0fecaba2b8c46c6e970cf637d9625b01bf7e5
  kNptdNbW1tbWYghvXIpwb25vPQAA////////cwAjLv8AXAB2ZXJhY2sAQW5v/62tra3Pz///////
  //////////////////////9c8GZpbHRlcmxvYWQAAAEAAwAAAABVYwC2XABmaWx0ZXJhZGQAAAAX
  Fxdn/////2V0F861tcqvEmAAACEAAABjYXB0dXJldmUAAH4AgAA1PNfX11x0Z2V0ZGF0YQBDACOw
  AQMAAAAGIm5GERoLWcqvEmBD61u/KMNPOl4zKh/HKLK3PPGIkQ9eE/////////8AAAAAAAAAAFtb
  WyjDTzpeMSofx7K3PNfX11x0Z2V0ZGF0YQBDACMwAQMAAAAGIm5GERoLWcqvEmBD61u/KMNPOl4z
  Kh/Hsrc88YiRD2/Nzc3Nzc3Nzc3NTc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N
  zWWj1NTUudTU1NTU1P///0j+P/9cdHR4AAAAAAAAy/4AAHR4AAAAAAAAP8v+AAD/+P//////////
  AX55bJl8HWnz/////wAgXGF0YVPxY2RkAAAA
  ```

  And running the fuzz target:

  ```
  $ FUZZ=process_messages ./src/test/fuzz/fuzz -runs=1 -timeout=18 ./timeout-ada0fecaba2b8c46c6e970cf637d9625b01bf7e5
  INFO: Running with entropic power schedule (0xFF, 100).
  INFO: Seed: 3436516708
  INFO: Loaded 1 modules   (390807 inline 8-bit counters): 390807 [0x55d0d6221e80, 0x55d0d6281517),
  INFO: Loaded 1 PC tables (390807 PCs): 390807 [0x55d0d6281518,0x55d0d6877e88),
  ./src/test/fuzz/fuzz: Running 1 inputs 1 time(s) each.
  Running: ./timeout-ada0fecaba2b8c46c6e970cf637d9625b01bf7e5
  ALARM: working on the last Unit for 19 seconds
         and the timeout value is 18 (use -timeout=N to change)
  ==375014== ERROR: libFuzzer: timeout after 19 seconds
  ```

ACKs for top commit:
  naumenkogs:
    ACK 9f265d8825
  dergoegge:
    ACK 9f265d8825
  brunoerg:
    ACK 9f265d8825

Tree-SHA512: da83ff90962bb679aae00e8e9dba639c180b7aaba544e0c4d0978d36e28a9ff1cd7a2e13009d8ab407ef57767656aca1ebc767a7d2f1bc880284f8f57c197a50
2023-12-11 15:05:40 +00:00
fanquake
40bc501bf4
Merge bitcoin/bitcoin#29031: fuzz: Improve fuzzing stability for txorphan harness
15f5a0d0c8 fuzz: Improve fuzzing stability for txorphan harness (dergoegge)

Pull request description:

  The `txorphan` harness has low stability as eviction of orphan txs is entirely random at the moment.

  Fix this by passing the rng to `LimitOrphans`, which can be deterministic in tests.

  Also see #29018.

ACKs for top commit:
  maflcko:
    lgtm ACK 15f5a0d0c8
  brunoerg:
    utACK 15f5a0d0c8

Tree-SHA512: 854ec34b3a0f16f26db6dc419096c6e7a380e8400119534aa278d6b1d54c253b572aa2fad13c383c796c431d8ff4263956e6f60326e99f8bf6abd16d9a280e97
2023-12-11 12:34:41 +00:00
fanquake
ba5f16e4a1
Merge bitcoin/bitcoin#29044: msvc: Define the same QT_... macros as in Autotools builds
1a5dae630d msvc: Define the same `QT_...` macros as in Autotools builds (Hennadii Stepanov)

Pull request description:

  There are no reasons to have such a diversion.

  Also it fixes https://github.com/bitcoin/bitcoin/pull/28960#issuecomment-1847971114.

ACKs for top commit:
  sipsorcery:
    tACK 1a5dae630d.
  TheCharlatan:
    ACK 1a5dae630d

Tree-SHA512: 75be5eabb8fec974b8d77a023c72323015a3d95fbc13b7fd85e5f25c250ae67850ddf0bcaef143828d75fe35a49e7c9b1966976b74f3ce7d14465174e6585ceb
2023-12-11 11:27:23 +00:00
fanquake
36fabb01b1
Merge bitcoin/bitcoin#29041: test: fix intermittent error in rpc_net.py (#29030)
ea00f982d2 test: fix intermittent error in rpc_net.py (#29030) (Sebastian Falbesoner)

Pull request description:

  Asserting for the debug log message "Added connection peer=" is insufficient for ensuring that this new connection will show up in a following getpeerinfo() call, as the debug message is written in the CNode ctor, which means it hasn't necessarily been added to CConnman.m_nodes at this point.

  Solve this by using the recently introduced `wait_for_new_peer` helper (see #29006,  commit 00e0658e77), which is more robust.

  Fixes #29030.

ACKs for top commit:
  maflcko:
    lgtm ACK ea00f982d2

Tree-SHA512: dda307949a466fb3b24408a8c213d307e0af2155f2e8b4e52c836a22397f9d218bf9d8c54ca55bae62a96d7566f27167db9311dd8801785c327234783af5ed00
2023-12-11 11:41:46 +01:00
fanquake
09ab9d4fa7
Merge bitcoin/bitcoin#29035: test: fix addnode functional test failure on OpenBSD
fd0bde2793 test: fix `addnode` functional test failure on OpenBSD (Sebastian Falbesoner)

Pull request description:

  This is the functional test counterpart of PR #28891 / commit 007d6f0e85 (unfortunately, I missed it back then and only ran the unit tests -- sorry for the noise).

  master branch on OpenBSD 7.4:
  ```
  $ ./test/functional/rpc_net.py
  2023-12-08T17:29:05.057000Z TestFramework (INFO): PRNG seed is: 6024296850131317403
  2023-12-08T17:29:05.058000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_au3zchif
  2023-12-08T17:29:05.618000Z TestFramework (INFO): Test getconnectioncount
  2023-12-08T17:29:05.618000Z TestFramework (INFO): Test getpeerinfo
  2023-12-08T17:29:06.643000Z TestFramework (INFO): Check getpeerinfo output before a version message was sent
  2023-12-08T17:29:06.709000Z TestFramework (INFO): Test getnettotals
  2023-12-08T17:29:06.773000Z TestFramework (INFO): Test getnetworkinfo
  2023-12-08T17:29:06.978000Z TestFramework (INFO): Test addnode and getaddednodeinfo
  2023-12-08T17:29:06.980000Z TestFramework (ERROR): Assertion failed
  Traceback (most recent call last):
    File "/home/thestack/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
      self.run_test()
    File "/home/thestack/bitcoin/./test/functional/rpc_net.py", line 65, in run_test
      self.test_addnode_getaddednodeinfo()
    File "/home/thestack/bitcoin/./test/functional/rpc_net.py", line 224, in test_addnode_getaddednodeinfo
      assert_raises_rpc_error(-23, "Node already added", self.nodes[0].addnode, node=ip_port2, command='add')
    File "/home/thestack/bitcoin/test/functional/test_framework/util.py", line 131, in assert_raises_rpc_error
      assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
  AssertionError: No exception raised
  ```

  On the PR branch, the same call succeeds.

ACKs for top commit:
  kevkevinpal:
    ACK [fd0bde2](fd0bde2793)

Tree-SHA512: ae20816fa4025c212e115ebd267b5e5784bfcdf0051219eb686faaade47ec4f91a3947af6d24258b159290000d2dcc3f6e65e788b83b8a9297282945dbdafbfb
2023-12-11 10:44:39 +01:00
fanquake
41e378a0a1
Merge bitcoin/bitcoin#29045: msvc: Optimize "Release" builds
6e0f1d2abb msvc: Optimize "Release" builds (Hennadii Stepanov)

Pull request description:

  It is awkward not using optimization.

  In addition to the obvious benefits for Windows users, this PR reduces the duration of functional tests by an hour.

  Picked from https://github.com/bitcoin/bitcoin/pull/24773.

ACKs for top commit:
  sipsorcery:
    tACK 6e0f1d2abb.

Tree-SHA512: 5aa7fd38cb1a81d58ea3206756a8099891866c82a747d3b8079cab0b2afa1f40ba53adff2f32eb233efcd1227babee80ab175e35a83678fafa8a4f63c356e5ca
2023-12-11 10:38:30 +01:00
fanquake
84bbee7b74
Merge bitcoin/bitcoin#29048: Add a note to msvc readme re building Qt for Bitcoin Core.
d08e820abf Add a note to msvc readme re building Qt for Bitcoin Core. (Aaron Clauson)

Pull request description:

  Updated the msvc readme with a note about avoiding path too long errors when building Qt with Bitcoin Core.

  Would have saved me half an hour if I'd remembered this from the last time I did the build.

ACKs for top commit:
  hebasto:
    ACK d08e820abf.
  TheCharlatan:
    ACK d08e820abf

Tree-SHA512: f51017b15383dbcd39ad1e5e978bb255b9205dc23d72b5e3530c6aefcbbc2dc4ec3a85e5fc8c0019c8511173c298f80b837cb35f268deac424d19365b25fb335
2023-12-11 10:18:39 +01:00
Aaron Clauson
d08e820abf
Add a note to msvc readme re building Qt for Bitcoin Core. 2023-12-10 15:46:36 +00:00
Hennadii Stepanov
1a5dae630d
msvc: Define the same QT_... macros as in Autotools builds 2023-12-09 16:15:33 +00:00
Murch
1553c80786
Add multiplication operator to CFeeRate 2023-12-09 09:33:45 -05:00
Hennadii Stepanov
6e0f1d2abb
msvc: Optimize "Release" builds
It is awkward not using optimization.
2023-12-09 13:15:30 +00:00
Sebastian Falbesoner
ea00f982d2 test: fix intermittent error in rpc_net.py (#29030)
Asserting for the debug log message "Added connection peer=" is
insufficient for ensuring that this new connection will show up in a
following getpeerinfo() call, as the debug message is written in the
CNode ctor, which means it hasn't necessarily been added to
CConnman.m_nodes at this point.

Solve this by using the recently introduced `wait_for_new_peer`
helper, which is more robust.

Fixes #29030.
2023-12-09 13:26:18 +01:00
Kashif Smith
94feaf2b66 tests: Add unit tests for bitcoin-tx replaceable command 2023-12-08 20:27:13 -05:00
Andrew Chow
0295b44c25 wallet: return CreatedTransactionResult from FundTransaction
Instead of using the output parameters, return CreatedTransactionResult
from FundTransaction in the same way that CreateTransaction does.
Additionally, instead of modifying the original CMutableTransaction, the
result from CreateTransactionInternal is used.
2023-12-08 17:12:19 -05:00
Andrew Chow
758501b713 wallet: use optional for change position as an optional in CreateTransaction
Instead of making -1 a magic number meaning no change or random change
position, use an optional to have that meaning.
2023-12-08 17:12:19 -05:00
Andrew Chow
2d39db7aa1 wallet: Explicitly preserve scriptSig and scriptWitness in CreateTransaction
When creating a transaction with preset inputs, also preserve the
scriptSig and scriptWitness for those preset inputs if they are provided
(e.g. in fundrawtransaction).
2023-12-08 17:12:19 -05:00
Andrew Chow
14e50746f6 wallet: Explicitly preserve transaction version in CreateTransaction
We provide the preset nVersion to CCoinControl so that
CreateTransactionInternal can be aware of it and set it in the produced
transaction.
2023-12-08 14:55:14 -05:00
Andrew Chow
0fefcbb776 wallet: Explicitly preserve transaction locktime in CreateTransaction
We provide the preset nLockTime to CCoinControl so that
CreateTransactionInternal can be aware of it and set it in the produced
transaction.
2023-12-08 14:55:14 -05:00
Andrew Chow
4d335bb1e0 wallet: Set preset input sequence through coin control 2023-12-08 14:55:14 -05:00
Andrew Chow
596642c5a9 wallet: Replace SelectExternal with SetTxOut
Instead of having a separate CCoinControl::SelectExternal function, we
can use the normal CCoinControl::Select function and explicitly use
PreselectedInput::SetTxOut in the caller. The semantics of what an
external input is remains.
2023-12-08 14:55:14 -05:00
Andrew Chow
5321786b9d coincontrol: Replace HasInputWeight with returning optional from Get 2023-12-08 14:55:14 -05:00
Andrew Chow
e1abfb5b20 wallet: Introduce and use PreselectedInput class in CCoinControl
Instead of having different maps for selected inputs, external inputs,
and input weight in CCoinControl, have a class PreselectedInput which
tracks stores that information for each input.
2023-12-08 14:54:48 -05:00
Sebastian Falbesoner
fd0bde2793 test: fix addnode functional test failure on OpenBSD
This is the functional test counterpart of PR #28891 /
commit 007d6f0e85.
2023-12-08 18:27:15 +01:00
Sebastian Falbesoner
878d914777 doc: test: mention OS detection preferences in style guideline 2023-12-08 18:16:27 +01:00
Sebastian Falbesoner
4c65ac96f8 test: detect OS consistently using platform.system() 2023-12-08 18:16:24 +01:00
Sebastian Falbesoner
37324ae3df test: use skip_if_platform_not_linux helper where possible
Rather than re-implementing these checks, we can use this test
framework's helper (introduced in commit
c934087b62, PR #24358) called in a test's
`skip_test_if_missing_module` method instead.
2023-12-08 18:15:34 +01:00
dergoegge
15f5a0d0c8 fuzz: Improve fuzzing stability for txorphan harness 2023-12-08 13:14:46 +00:00