Commit graph

43143 commits

Author SHA1 Message Date
0xb10c
d524c1ec06
tracing: dedup TRACE macros & rename to TRACEPOINT
This deduplicates the TRACEx macros by using systemtaps STAP_PROBEV[0]
variadic macro instead of the DTrace compability DTRACE_PROBE[1] macros.
Bitcoin Core never had DTrace tracepoints, so we don't need to use the
drop-in replacement for it. As noted in pr25541[2], these macros aren't
compatibile with DTrace on macOS anyway.

This also renames the TRACEx macro to TRACEPOINT to clarify what the
macro does: inserting a tracepoint vs tracing (logging) something.

[0]: https://sourceware.org/git/?p=systemtap.git;a=blob;f=includes/sys/sdt.h;h=24d5e01c37805e55c36f7202e5d4e821b85167a1;hb=ecab2afea46099b4e7dfd551462689224afdbe3a#l407
[1]: https://sourceware.org/git/?p=systemtap.git;a=blob;f=includes/sys/sdt.h;h=24d5e01c37805e55c36f7202e5d4e821b85167a1;hb=ecab2afea46099b4e7dfd551462689224afdbe3a#l490
[2]: https://github.com/bitcoin/bitcoin/pull/25541/files#diff-553886c5f808e01e3452c7b21e879cc355da388ef7680bf310f6acb926d43266R30-R31

Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
2024-10-28 14:23:47 +01:00
Hennadii Stepanov
70713303b6
scripted-diff: Rename PACKAGE_* variables to CLIENT_*
This change ensures consistent use of the `CLIENT_` namespace everywhere
in the repository.

-BEGIN VERIFY SCRIPT-

ren() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./cmake ./src :\(exclude\)./src/secp256k1 ./test ) ; }

ren PACKAGE_NAME      CLIENT_NAME
ren PACKAGE_VERSION   CLIENT_VERSION_STRING
ren PACKAGE_URL       CLIENT_URL
ren PACKAGE_BUGREPORT CLIENT_BUGREPORT

-END VERIFY SCRIPT-
2024-10-28 12:36:19 +00:00
Hennadii Stepanov
332655cb52
build: Rename PACKAGE_* variables to CLIENT_*
The use of `PACKAGE_NAME` for the project's variable name is
problematic, as this name is commonly used in CMake's interface
variables. If third-party CMake code handles with scopes improperly,
our `PACKAGE_NAME` variable could end up with an unexpected value.

This change avoids such conflicts by renaming all `PACKAGE_*` variables
to `CLIENT_*`.
2024-10-28 12:35:55 +00:00
Hennadii Stepanov
e6e29e3c94
scripted-diff: Clarify "user agent" variable name
This change allows to the use of the `CLIENT_` namespace without
potential name clashes.

-BEGIN VERIFY SCRIPT-
sed -i "s/\<CLIENT_NAME\>/UA_NAME/g" $( git grep -l "CLIENT_NAME" ./src)
-END VERIFY SCRIPT-
2024-10-28 12:35:49 +00:00
Hennadii Stepanov
e2ba823671
depends: Specify CMake generator explicitly
Building packages in depends implies using GNU Make. However, this
assumption can be wrong in environments where the `CMAKE_GENERATOR`
variable is set.
This change explicitly makes CMake use the "Unix Makefiles" generator.
2024-10-28 11:25:06 +00:00
merge-script
1c7ca6e64d
Merge bitcoin/bitcoin#31093: Introduce g_fuzzing global for fuzzing checks
9f243cd7fa Introduce `g_fuzzing` global for fuzzing checks (dergoegge)

Pull request description:

  This PR introduces a global `g_fuzzing` that indicates if we are fuzzing.

  If `g_fuzzing` is `true` then:

  * Assume checks are enabled
  * Special fuzzing paths are taken (e.g. pow check is reduced to one bit)

  Closes #30950 #31057

ACKs for top commit:
  maflcko:
    review ACK 9f243cd7fa 🗜
  brunoerg:
    crACK 9f243cd7fa
  marcofleon:
    Tested ACK 9f243cd7fa

Tree-SHA512: 56e4cad0555dec0c565ea5ecc529628ee4f37d20dc660c647fdc6948fbeed8291e6fe290de514bd4c2c7089654d9ce1add607dc9855462828b62be9ee45e4999
2024-10-28 11:05:50 +00:00
merge-script
6e21dedbf2
Merge bitcoin/bitcoin#31130: Drop miniupnp dependency
40e5f26a3f mapport: remove dead code in DispatchMapPort (Antoine Poinsot)
38fdf7c1fb mapport: drop outdated comments (Antoine Poinsot)
b7b2435290 doc: add release note for #31130 (Antoine Poinsot)
1b6dec98da depends: drop miniupnpc (Antoine Poinsot)
953533d021 doc: remove mentions of UPnP (Antoine Poinsot)
94ad614482 ci: remove UPnP options (Antoine Poinsot)
a9598e5eaa build: drop miniupnpc dependency (Antoine Poinsot)
a5fcfb7385 interfaces: remove now unused 'use_upnp' arg from 'mapPort' (Antoine Poinsot)
038bbe7b20 daemon: remove UPnP support (Antoine Poinsot)
844770b05e qt: remove UPnP settings (Antoine Poinsot)

Pull request description:

  This PR removes UPnP IGD support and drops our [miniupnp](https://github.com/miniupnp/miniupnp) dependency.

  Miniupnpc is a C library (somewhat) maintained by a single person which had several vulnerabilities in the past (a couple dozens are listed [here](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=miniupnp)), some of which directly affected our software ([RCE in 2015](https://bitcoincore.org/en/2024/07/03/disclose_upnp_rce/), [OOM in 2020](https://bitcoincore.org/en/2024/07/31/disclose-upnp-oom/)).

  The main purpose of this functionality is to have more (non-data-center) reachable nodes on the network. For a non-technical user running Bitcoin Core at home, the software would automatically open a port on their router to receive incoming connections. This way, users not able to manually open a port on their router would still provide the network with more resources and enhance its diversity.

  However, due to past vulnerabilities (and a worry about unknown future ones) in miniupnpc this feature was disabled by default in https://github.com/bitcoin/bitcoin/pull/6795. Having it disabled by default kills (most of?) the purpose of having this functionality in the first place: someone technical enough to understand the `-upnp` startup option or the "enable UPnP" setting is most likely able to open a port on his box in the first place.

  In addition, laanwj implemented PCP with a NAT-PMP fallback directly in Bitcoin Core in https://github.com/bitcoin/bitcoin/pull/30043. If we ever want to re-enable automatic NAT traversal by default in Bitcoin Core, this is the best option (and in my opinion the only sane one). The NAT-PMP fallback makes it so compatibility shouldn't be (much of) an issue.

  On balance, i believe that keeping this functionality and this barely maintained C dependency has higher costs than benefits. Therefore i propose that we get rid of it.

ACKs for top commit:
  jarolrod:
    ACK 40e5f26a3f
  1440000bytes:
    Code Review ACK 40e5f26a3f
  laanwj:
    Code review ACK 40e5f26a3f
  i-am-yuvi:
    Tested ACK 40e5f26a3f

Tree-SHA512: 9ea48662775510f5ec6de7af65790f7c8d211603398e9d8c634a86387be81b28081419a95b4d6680d3d7fe6a9f16cec99f16516548201dc7e49781909899a657
2024-10-28 10:47:34 +00:00
kevkevinpal
d7fd766feb
test: added test to assert TX decode rpc error on submitpackage rpc 2024-10-27 15:17:23 -04:00
Sebastian Falbesoner
559a8dd9c0 key: clear out secret data in DecodeExtKey
Same as in `DecodeSecret`, we should also clear out the secret data from
the vector resulting from the Base58Check parsing for xprv keys. Note
that the if condition is needed in order to avoid UB, see #14242 (commit
d855e4cac8).
2024-10-27 15:38:54 +01:00
Sebastian Falbesoner
4120c7543e scripted-diff: get rid of remaining "command" terminology in protocol.{h,cpp}
-BEGIN VERIFY SCRIPT-
sed -i s/COMMAND_SIZE/MESSAGE_TYPE_SIZE/g $(git grep -l COMMAND_SIZE)
sed -i s/pszCommand/msg_type/g $(git grep -l pszCommand)
sed -i s/pchCommand/m_msg_type/g $(git grep -l pchCommand)
sed -i s/GetCommand/GetMessageType/g ./src/net.cpp ./src/protocol.cpp ./src/protocol.h ./src/test/fuzz/protocol.cpp
sed -i s/IsCommandValid/IsMessageTypeValid/g $(git grep -l IsCommandValid)
sed -i "s/command/message type/g" ./src/protocol.h ./src/protocol.cpp
-END VERIFY SCRIPT-
2024-10-26 23:44:15 +02:00
glozow
2a52718d73
Merge bitcoin/bitcoin#31152: functional test: Additional package evaluation coverage
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Has been cancelled
CI / Win64 native, VS 2022 (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
f32c34d0c3 functional test: Additional package evaluation coverage (Greg Sanders)

Pull request description:

  Current test coverage doesn't ensure that mempool trimming doesn't appear prior to the entire package, and not just the subpackage, is finished being submitted.

  Add a scenario that covers this case, where package ancestors can make it in individually, but would be immadiately evicted if not for the package CPFP.

  in response to https://github.com/bitcoin/bitcoin/pull/31122#discussion_r1813272637 where if applied onto that PR's old commit, the test fails due to package failure.

ACKs for top commit:
  sdaftuar:
    re-ACK f32c34d0c3
  rkrux:
    tACK f32c34d0c3
  glozow:
    reACK f32c34d0c3

Tree-SHA512: 739fcc5e66878b3def9b25dc588d8cb5349aaaa0901b11475879a413a03f6ea0e87d19de5bc4fb44ddd0436fdc052cdc3ed564f7e2ad510269aab9732d5c24eb
2024-10-26 09:37:20 -04:00
tdb3
9de9c858d5
test: enhance p2p_orphan_handling
Increases test robustness by adding
checks for orphanage size and presence
of orphans in the orphanage
2024-10-25 20:46:00 -04:00
tdb3
33af14b62e
test: reduce assert_debug_log reliance
p2p_orphan_handling now uses tx_in_orphanage
to more directly check for inclusion/exclusion
in the orphanage.
2024-10-25 18:52:39 -04:00
tdb3
0ea84bc362
test: explicitly check boolean verbosity is disallowed 2024-10-25 17:54:05 -04:00
tdb3
7a2e6b68cd
doc: add rpc guidance for boolean verbosity avoidance 2024-10-25 17:54:04 -04:00
tdb3
698f302df8
rpc: disallow boolean verbosity in getorphantxs
Updates ParseVerbosity() to support disallowing
boolean verbosity.  Removes boolean verbosity
for getorphantxs to encourage integer verbosity
usage
2024-10-25 17:53:48 -04:00
tdb3
63f5e6ec79
test: add entry and expiration time checks 2024-10-25 17:11:27 -04:00
tdb3
808a708107
rpc: add entry time to getorphantxs 2024-10-25 17:11:26 -04:00
tdb3
56bf302714
refactor: rename rpc_getorphantxs to rpc_orphans
Generalizes the test to accommodate additional
orphan-related RPCs
2024-10-25 17:11:20 -04:00
tdb3
7824f6b077
test: check that getorphantxs is hidden 2024-10-25 17:11:12 -04:00
tdb3
ac68fcca70
rpc: disallow undefined verbosity in getorphantxs 2024-10-25 17:06:12 -04:00
Ava Chow
25dacae9c7
Merge bitcoin/bitcoin#31040: test: Assert that when we add the max orphan amount that we cannot add anymore and that a random orphan gets dropped
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
5c299ecafe test: Assert that when we add the max orphan amount that we cannot add anymore and that a random orphan gets dropped (kevkevinpal)

Pull request description:

  After joining the bitcoin pr review club about https://github.com/bitcoin/bitcoin/pull/30793

  I learned about [`CVE-2012-3789`](https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp#L4693)

  So I was motivated to write a functional test that covers this part of the code,

  This test should add the max number of orphans to a nodes orphanage and then attempt to add another, then asserts that the number of orphans is still at the max amount

ACKs for top commit:
  achow101:
    ACK 5c299ecafe
  rkrux:
    ACK 5c299ecafe
  instagibbs:
    ACK 5c299ecafe
  tdb3:
    ACK 5c299ecafe

Tree-SHA512: 687bba337978e0945e94af71632998221e5565a5d83cf5a59ecf2ee52c7262d8ff907b94dceea3b80bed441dd19b24790b2904e88e1da14d30827c5469fcb4d3
2024-10-25 16:35:18 -04:00
Antoine Poinsot
40e5f26a3f
mapport: remove dead code in DispatchMapPort
Since there is now only two options in the MapPortProtoFlag enum, the
four possible combinations of current and enabled are already covered in
the four `if` branches.
2024-10-25 15:02:07 -04:00
Antoine Poinsot
38fdf7c1fb
mapport: drop outdated comments 2024-10-25 14:39:03 -04:00
Cory Fields
915640e191
depends: zeromq: don't install .pc files and remove patches for them 2024-10-25 18:11:43 +01:00
Hennadii Stepanov
6b8a74463b
cmake: Add FindZeroMQ module 2024-10-25 18:09:36 +01:00
merge-script
9a7206a34e
Merge bitcoin/bitcoin#29536: fuzz: fuzz connman with non-empty addrman + ASMap
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
552cae243a fuzz: cover `ASMapHealthCheck` in connman target (brunoerg)
33b0f3ae96 fuzz: use `ConsumeNetGroupManager` in connman target (brunoerg)
18c8a0945b fuzz: move `ConsumeNetGroupManager` to util (brunoerg)
fe624631ae fuzz: fuzz `connman` with a non-empty addrman (brunoerg)
0a12cff2a8 fuzz: move `AddrManDeterministic` to util (brunoerg)

Pull request description:

  ### Motivation

  Currently, we fuzz connman with an addrman from `NodeContext`. However,
  fuzzing connman with only empty addrman might not be effective, especially
  for functions like `GetAddresses` and other ones that plays with addrman. Also,
  we do not fuzz connman with ASMap, what would be good for functions that need
  `GetGroup`, or even for addrman. Without it, I do not see how effective would be
   fuzzing `ASMapHealthCheck`, for example.

  ### Changes

  - Move `AddrManDeterministic` and `ConsumeNetGroupManager` to util.
  - Use `ConsumeNetGroupManager` in connman target to construct a netgroupmanager
  and use it for `ConnmanTestMsg`.
  - Use `AddrManDeterministic` in connman target to create an addrman. It does
   not slow down as "filling" the addrman (e.g. with `FillAddrman`).
  - Add coverage for `ASMapHealthCheck`.

ACKs for top commit:
  maflcko:
    review ACK 552cae243a 🏀
  dergoegge:
    Code review ACK 552cae243a
  marcofleon:
    Code review ACK 552cae243a. Changes match the PR description.

Tree-SHA512: ba861c839602054077e4bf3649763eeb48357cda83ca3ddd32b02a1b61f4e44a0c5070182f001f9bf531d0d64717876279a7de3ddb9de028b343533b89233851
2024-10-25 15:18:54 +01:00
merge-script
d4abaf8c9d
Merge bitcoin/bitcoin#29608: optimization: Preallocate addresses in GetAddr based on nNodes
66082ca348 Preallocate addresses in GetAddr based on nNodes (Lőrinc)

Pull request description:

  The reserve method optimizes memory allocation by preallocating space for the expected number of elements (nNodes), reducing reallocations and improving performance. The upper bound ensures efficient memory usage based on the input constraints.

  before:
  ```
  |               ns/op |                op/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |           76,852.79 |           13,011.89 |    0.4% |      1.07 | `AddrManGetAddr`
  |           76,598.21 |           13,055.14 |    0.2% |      1.07 | `AddrManGetAddr`
  |           76,296.32 |           13,106.79 |    0.1% |      1.07 | `AddrManGetAddr`
  ```

  after:
  ```
  |               ns/op |                op/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |           65,966.97 |           15,159.10 |    0.3% |      1.07 | `AddrManGetAddr`
  |           66,075.40 |           15,134.23 |    0.2% |      1.06 | `AddrManGetAddr`
  |           66,306.34 |           15,081.51 |    0.3% |      1.06 | `AddrManGetAddr`
  ```

ACKs for top commit:
  stickies-v:
    ACK 66082ca348
  vasild:
    ACK 66082ca348

Tree-SHA512: 1175cff250d9c52ed042e8807ddc2afd64a806e6f2195b5c648752869ff3beec0be8a8cbd7ab6ba35cd7077d79b88a380da6c6e244f5549f98cdd472808b6d8f
2024-10-25 14:45:42 +01:00
Antoine Poinsot
b7b2435290
doc: add release note for #31130 2024-10-25 09:27:30 -04:00
Antoine Poinsot
1b6dec98da
depends: drop miniupnpc 2024-10-25 09:27:30 -04:00
Antoine Poinsot
953533d021
doc: remove mentions of UPnP 2024-10-25 09:27:29 -04:00
Antoine Poinsot
94ad614482
ci: remove UPnP options 2024-10-25 09:27:12 -04:00
Greg Sanders
f32c34d0c3 functional test: Additional package evaluation coverage
Current test coverage doesn't ensure that mempool trimming
doesn't appear prior to the entire package, and not just
the subpackage, is finished being submitted.

Add a scenario that covers this case, where package
ancestors can make it in individually, but would be
immadiately evicted if not for the package CPFP.
2024-10-25 09:22:57 -04:00
Jon Atack
87532fe558 netinfo: allow setting an outbound-only peer list
by passing an additional argument of "outonly" or "o".

This has been requested in order to keep the output within screen limits when running -netinfo
as a live dashboard, i.e. with `watch`.

Also allow passing "h" in addition to "help" to see the help documentation.
2024-10-25 07:22:15 -06:00
dergoegge
9f243cd7fa Introduce g_fuzzing global for fuzzing checks 2024-10-25 13:12:55 +01:00
merge-script
b95adf057a
Merge bitcoin/bitcoin#31150: util: Treat Assume as Assert when evaluating at compile-time
fa69a5f4b7 util: Treat Assume as Assert when evaluating at compile-time (MarcoFalke)

Pull request description:

  There is no downside or cost of treating an `Assume` at compile-time as an `Assert` and it may even help to find bugs while compiling without `ABORT_ON_FAILED_ASSUME`.

  This is also required for https://github.com/bitcoin/bitcoin/pull/31093

ACKs for top commit:
  dergoegge:
    ACK fa69a5f4b7
  brunoerg:
    ACK fa69a5f4b7
  marcofleon:
    ACK fa69a5f4b7

Tree-SHA512: 17604403f841343a6d5b6e5d777e1760d38e0c27dc1fd4479e3741894fba40cdb1fb659cf24519a51d051bd5884a75992d1227ec9fa40fbf53bc619fbfb304ad
2024-10-25 13:10:19 +01:00
merge-script
8f24e492e2
Merge bitcoin/bitcoin#29991: depends: sqlite 3.46.1
def6dd0c59 depends: sqlite 3.46.1 (fanquake)

Pull request description:

  Update sqlite in depends from [3.38.5](https://sqlite.org/releaselog/3_38_5.html) to [3.46.1](https://sqlite.org/releaselog/3_46_1.html).

ACKs for top commit:
  TheCharlatan:
    ACK def6dd0c59
  theuni:
    Not opposed utACK def6dd0c59

Tree-SHA512: 1f12c8ed8d05600b8240bcdbad5cf7d073ea5ab0bbd4a0f49a39ccfe1a93c043ee855b6eb0c67028edec57d8c21588dc33246e64d0b94feafad1a6ec38839893
2024-10-25 11:43:09 +01:00
merge-script
2ef5004f78
Merge bitcoin/bitcoin#31146: ci: Temporary workaround for old CCACHE_DIR cirrus env
fa9747a896 ci: Temporary workaround for old CCACHE_DIR cirrus env (MarcoFalke)

Pull request description:

  On a CI re-run, the historic env vars and CI config is used from Cirrus. However, the most recent CI config and CI scripts from this repo are used. This may lead to issues.

  For example, `CCACHE_DIR` in the old location may be missing on new CI workers and lead to errors.

  Fix it, by falling back to the old logic when the old `CCACHE_DIR` was detected.

ACKs for top commit:
  fanquake:
    ACK fa9747a896 - have seen this now.

Tree-SHA512: 04f0ca8d09ab0b8216a474fde1e05b79fbc6524884be173e8d728799739b026cda18d1797e0fe53d7e1b0ea69c0485acfe4f8a8f85408ea5bfdcffcf13a7ce55
2024-10-25 10:46:04 +01:00
merge-script
8c12fe828d
Merge bitcoin/bitcoin#29936: fuzz: wallet: add target for CreateTransaction
c495731a31 fuzz: wallet: add target for `CreateTransaction` (brunoerg)
3db68e29ec wallet: move `ImportDescriptors`/`FuzzedWallet` to util (brunoerg)

Pull request description:

  This PR adds a fuzz target for the `CreateTransaction` function. It is a regression target for https://github.com/bitcoin/bitcoin/pull/27271 and can be testing by applying:
  ```diff
  @@ -1110,7 +1110,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
       // This can only happen if feerate is 0, and requested destinations are value of 0 (e.g. OP_RETURN)
       // and no pre-selected inputs. This will result in 0-input transaction, which is consensus-invalid anyways
       if (selection_target == 0 && !coin_control.HasSelected()) {
  -        return util::Error{_("Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input")};
  +       // return util::Error{_("Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input")};
       }
  ```

  Also, it moves `ImportDescriptors` function to `src/wallet/test/util.h` to avoid to duplicate same code.

ACKs for top commit:
  marcofleon:
    ACK c495731a31
  maflcko:
    ACK c495731a31 🏻

Tree-SHA512: a439f947b91b01e327e18cd18e63d5ce49f2cb9ca16ca9d56fe337b8cff239b3af4db18fe89478fe5faa5549d37ca935bd321913db7646fbf6818f825cb5d878
2024-10-25 09:17:31 +01:00
kevkevinpal
5c299ecafe
test: Assert that when we add the max orphan amount that we cannot add anymore and that a random orphan gets dropped 2024-10-24 21:48:39 -04:00
glozow
0f4bc63585 [fuzz] txdownloadman and txdownload_impl
The txdownload_impl is similar but allows us to check specific
invariants within its implementation. It will also change a lot more
than the external interface (txdownloadman) will, so we will add more to
this target later.
2024-10-24 21:23:56 -04:00
glozow
699643f23a [unit test] MempoolRejectedTx 2024-10-24 21:23:56 -04:00
glozow
fa584cbe72 [p2p] add TxDownloadOptions bool to make TxRequestTracker deterministic
Forward this bool to the TxRequestTracker ctor. This is needed for
stablity in TxDownloadManager fuzzers
2024-10-24 21:23:56 -04:00
glozow
f803c8ce8d [p2p] filter 1p1c for child txid in recent rejects
Avoid the fuzzer situation where:
1. Orphanage has 2 transactions with the same txid, one with witness,
   one without witness.
2. The transaction with witness is found to have
   `TX_INPUTS_NOT_STANDARD` error. The txid is added to recent rejects
filter, and the tx with witness is deleted from orphanage.
3. A low feerate parent is found. Find1P1CPackage finds the transaction
   with no witness in orphanage, and returns the package.
4. net_processing has just been handed a package in which the child is
   already in recent rejects.
2024-10-24 21:23:56 -04:00
glozow
5269d57e6d [p2p] don't process orphan if in recent rejects
This should never happen normally, but just in case.
2024-10-24 21:23:56 -04:00
glozow
2266eba43a [p2p] don't find 1p1cs for reconsiderable txns that are AlreadyHaveTx
This is a slight behavior change: if a transaction is in both
reconsiderable rejects and AlreadyHaveTx in another way, we don't try to
return a 1p1c package. This is the correct thing to do, as we don't want
to reconsider transactions that have multiple things wrong with them.
For example, if a transaction is low feerate, and then later found to
have a bad signature, we shouldn't try it again in a package.
2024-10-24 21:23:56 -04:00
glozow
fa7027d0fc [refactor] add CheckIsEmpty and GetOrphanTransactions, remove access to TxDownloadMan internals 2024-10-24 21:23:56 -04:00
glozow
969b07237b [refactor] wrap {Have,Get}TxToReconsider in txdownload 2024-10-24 21:23:56 -04:00
glozow
f150fb94e7 [refactor] make AlreadyHaveTx and Find1P1CPackage private to TxDownloadImpl 2024-10-24 21:23:56 -04:00
glozow
1e08195135 [refactor] move new tx logic to txdownload
Also delete external RecentRejectsReconsiderableFilter() access since it
is no longer necessary.
2024-10-24 21:23:56 -04:00