net: reject oversized outbound messages #35888

Open
l0rinc wants to merge 5 commits from l0rinc/net-reject-oversized-message-types into master AGit
l0rinc commented 2026-08-04 22:36:58 +00:00 (Migrated from github.com)

Problem: Outbound transports encode message types in a fixed 12-byte field, but CConnman did not ensure internal callers respected this limit before queuing messages.
An oversized type aborts V1 encoding. V2 sends it under a truncated type with its payload intact, or writes past its encoding buffer when the payload is shorter than the excess type bytes.
The send path also did not enforce the 4 MB payload limit.
Private broadcast could reach this path with an oversized witness variant of a transaction already in the mempool.

Fix: Treat oversized types and payloads as failed assumptions in CConnman::PushMessage() before they enter the send queue.
Use the validated mempool transaction when privately rebroadcasting a transaction already in the mempool.
The testing-only sendmsgtopeer RPC rejects oversized payloads before calling PushMessage().

**Problem:** Outbound transports encode message types in a fixed 12-byte field, but `CConnman` did not ensure internal callers respected this limit before queuing messages. An oversized type aborts V1 encoding. V2 sends it under a truncated type with its payload intact, or writes past its encoding buffer when the payload is shorter than the excess type bytes. The send path also did not enforce the 4 MB payload limit. Private broadcast could reach this path with an oversized witness variant of a transaction already in the mempool. **Fix:** Treat oversized types and payloads as failed assumptions in `CConnman::PushMessage()` before they enter the send queue. Use the validated mempool transaction when privately rebroadcasting a transaction already in the mempool. The testing-only `sendmsgtopeer` RPC rejects oversized payloads before calling `PushMessage()`.
DrahtBot commented 2026-08-04 22:37:05 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK ajtowns, naiyoma

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36607 (private broadcast: Extra guard against unintended non-private broadcast of private transactions by optout21)
  • #36429 ([RFC] Scheduled transaction broadcast, minimal by optout21)
  • #33954 (test: add functional test for outbound connection management by mzumsande)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35888 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35888.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35888#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Concept ACK | [ajtowns](https://github.com/bitcoin/bitcoin/pull/35888#issuecomment-5198628979), [naiyoma](https://github.com/bitcoin/bitcoin/pull/35888#pullrequestreview-5191744155) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36607](https://github.com/bitcoin/bitcoin/pull/36607) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36607.svg"></sub> (private broadcast: Extra guard against unintended non-private broadcast of private transactions by optout21) * [#36429](https://github.com/bitcoin/bitcoin/pull/36429) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36429.svg"></sub> ([RFC] Scheduled transaction broadcast, minimal by optout21) * [#33954](https://github.com/bitcoin/bitcoin/pull/33954) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/33954.svg"></sub> (test: add functional test for outbound connection management by mzumsande) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
ajtowns (Migrated from github.com) reviewed 2026-08-05 23:40:01 +00:00
ajtowns (Migrated from github.com) commented 2026-08-05 23:39:50 +00:00

Assume(MessageIsWithinLimits(msg)) might read better? Should this test be part of the CSerializedNetMsg class in protocol.h? Would probably be a useful place to add documentation that code constructing these msgs must ensure they're not oversized.

`Assume(MessageIsWithinLimits(msg))` might read better? Should this test be part of the `CSerializedNetMsg` class in protocol.h? Would probably be a useful place to add documentation that code constructing these msgs must ensure they're not oversized.
ajtowns (Migrated from github.com) commented 2026-08-05 23:35:56 +00:00
constexpr std::string MAX_MESSAGE_TYPE{"xxxxxxxxxxxx"};
static_assert(MAX_MESSAGE_TYPE.size() == MESSAGE_TYPE_SIZE);

would be easier for the reader I think.

```c++ constexpr std::string MAX_MESSAGE_TYPE{"xxxxxxxxxxxx"}; static_assert(MAX_MESSAGE_TYPE.size() == MESSAGE_TYPE_SIZE); ``` would be easier for the reader I think.
ajtowns commented 2026-08-05 23:40:16 +00:00 (Migrated from github.com)

Concept ACK

Can you explain your thinking / where you were coming from in relation to https://github.com/bitcoin/bitcoin/pull/35880#pullrequestreview-4858213755 some more? Even if whatever the concerns were are resolved to your satisfaction already, it makes me think there's a hole in my understanding here that I'd like to fill before reviewing properly.

Concept ACK Can you explain your thinking / where you were coming from in relation to https://github.com/bitcoin/bitcoin/pull/35880#pullrequestreview-4858213755 some more? Even if whatever the concerns were are resolved to your satisfaction already, it makes me think there's a hole in my understanding here that I'd like to fill before reviewing properly.
l0rinc commented 2026-08-06 20:24:51 +00:00 (Migrated from github.com)

it makes me think there's a hole in my understanding here

I don't think you're missing anything on the receive side. I had already found that the related send path was missing checks, so when this fuzz failure showed another oversized-message case, I wanted to verify both paths before excluding it. At that point I hadn't established that the fuzzer was bypassing a receive-side guarantee, so I treated the outbound failure as something the send path should reject.

There was also a more directly related reason I did not want to assume every receive-side limit was enforced early: https://github.com/bitcoin/bitcoin/pull/35936 found that getblocks and getheaders enforced MAX_LOCATOR_SZ only after deserialization, so a truncated oversized locator could allocate and throw before reaching the disconnect check. (edited)

I was also cautious because similar fuzz constraints and sanitizer workarounds had hidden actual problems before:

After tracing this case, I agree that an oversized transaction cannot reach this path from a real peer, so restricting the fuzz target is correct. Thanks for the pushback and feedback.

Concept ACK

Addressed your suggestions, thanks, pushed.
Edit: it seems libc++ has some problems with constexpr strings, so I changed it to std::string_view and materialized on call site.

> it makes me think there's a hole in my understanding here I don't think you're missing anything on the receive side. I had already found that the related send path was missing checks, so when this fuzz failure showed another oversized-message case, I wanted to verify both paths before excluding it. At that point I hadn't established that the fuzzer was bypassing a receive-side guarantee, so I treated the outbound failure as something the send path should reject. There was also a more directly related reason I did not want to assume every receive-side limit was enforced early: https://github.com/bitcoin/bitcoin/pull/35936 found that `getblocks` and `getheaders` enforced `MAX_LOCATOR_SZ` only after deserialization, so a truncated oversized locator could allocate and throw before reaching the disconnect check. (edited) I was also cautious because similar fuzz constraints and sanitizer workarounds had hidden actual problems before: * the [headers-sync target kept the clock above the underflow case](https://github.com/bitcoin/bitcoin/pull/35208/changes#diff-0d080ed70ead25af56b0d1b20d963d716304a8bfac42532cae84bb23c3573789L63) * the [coins-view target flushed corrupted accounting while UBSan suppressed the affected methods](https://github.com/bitcoin/bitcoin/pull/32313/changes/d7c9d6c2914aadd711544908d0fad8857a809c72) * the [crypto target replaced empty vectors to avoid UBSan instead of exposing the empty-key HMAC issue](https://github.com/bitcoin/bitcoin/pull/35688/changes#diff-d337bc8a42ed6b159b57c4bc5741812bac727131689b77823fc3435631d28705L24-L28) * the [bloom target constrained its parameters away from arithmetic UB](https://github.com/bitcoin/bitcoin/pull/35818/changes#diff-08488c05c2dbd34ba9a5fa69d512bc66046f286c2c33e84616986e22bff7076eL22-L23). After tracing this case, I agree that an oversized transaction cannot reach this path from a real peer, so restricting the fuzz target is correct. Thanks for the pushback and feedback. > Concept ACK Addressed your suggestions, thanks, pushed. Edit: it seems libc++ has some problems with `constexpr` strings, so I changed it to `std::string_view` and materialized on call site.
DrahtBot commented 2026-08-06 21:31:37 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task No wallet: https://github.com/bitcoin/bitcoin/actions/runs/31127401132/job/92703875334
LLM reason (✨ experimental): CI failed due to a Clang build error in src/test/net_tests.cpp: a constexpr std::string is not a constant expression, causing static_assert(MAX_MESSAGE_TYPE.size()...) to fail.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `No wallet`: https://github.com/bitcoin/bitcoin/actions/runs/31127401132/job/92703875334</sub> <sub>LLM reason (✨ experimental): CI failed due to a Clang build error in `src/test/net_tests.cpp`: a `constexpr std::string` is not a constant expression, causing `static_assert(MAX_MESSAGE_TYPE.size()...)` to fail.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
mzumsande (Migrated from github.com) reviewed 2026-08-10 17:13:55 +00:00
mzumsande (Migrated from github.com) commented 2026-08-10 17:06:02 +00:00

What is the reason for the non-debug build return instead of only adding the Assume?
I think if this was somehow reached in production, returning false would result in a stall of the connection for minutes (until it get disconnected for inactivity), since SocketSendData will never make progress.

Also, wouldn't it be nicer from an architectural point of view if arbitrary application-level rules such as the 4MB maximum message length wouldn't be enforced at the transport level, but only at the higher level (PushMessage) anyway?
Then we wouldn't need the same assumption 3 different places.

What is the reason for the non-debug build `return` instead of only adding the Assume? I think if this was somehow reached in production, returning false would result in a stall of the connection for minutes (until it get disconnected for inactivity), since `SocketSendData` will never make progress. Also, wouldn't it be nicer from an architectural point of view if arbitrary application-level rules such as the 4MB maximum message length wouldn't be enforced at the transport level, but only at the higher level (`PushMessage`) anyway? Then we wouldn't need the same assumption 3 different places.
mzumsande (Migrated from github.com) commented 2026-08-10 16:14:51 +00:00

I don't think it's a "problem" per se that sendmsgtopeer accepts payloads above the 4 MB protocol limit - it's a test RPC after all. The story should be that you want to add the assumption to prevent future regressions etc., and need to change the rpc for that - which is no loss because it's just a test rpc and oversized messages are being tested elsewhere.

I don't think it's a "problem" per se that `sendmsgtopeer` accepts payloads above the 4 MB protocol limit - it's a test RPC after all. The story should be that you want to add the assumption to prevent future regressions etc., and need to change the rpc for that - which is no loss because it's just a test rpc and oversized messages are being tested elsewhere.
DrahtBot commented 2026-08-14 17:49:43 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
l0rinc (Migrated from github.com) reviewed 2026-08-14 20:02:04 +00:00
l0rinc (Migrated from github.com) left a comment

Rebased and addressed @mzumsande's review: outbound limits are now enforced only in CConnman::PushMessage(), before messages enter the send queue, so a permanent rejection cannot stall SocketSendData() through SetMessageToSend(false). The sendmsgtopeer behavior and the PR rationale now reflect the RPC's testing-only role.

Rebased and addressed @mzumsande's review: outbound limits are now enforced only in `CConnman::PushMessage()`, before messages enter the send queue, so a permanent rejection cannot stall `SocketSendData()` through `SetMessageToSend(false)`. The `sendmsgtopeer` behavior and the PR rationale now reflect the RPC's testing-only role.
l0rinc (Migrated from github.com) commented 2026-08-10 19:26:43 +00:00

What is the reason for the non-debug build return instead of only adding the Assume?

It was suggested in https://github.com/bitcoin/bitcoin/pull/35880#issuecomment-5185966715.
I initially applied it because SetMessageToSend() already returns a boolean, and I treated false as a safe fallback in release builds while Assume exposed invalid callers in debug and fuzz builds.
Good catch that false will just try again later, so a permanently invalid message would remain queued and stall the connection.
I moved both size assumptions to PushMessage(), before the message enters the send queue.
This also keeps the 4 MB application-level rule out of the transports - added you as coauthor, thanks for the review.

> What is the reason for the non-debug build return instead of only adding the Assume? It was suggested in https://github.com/bitcoin/bitcoin/pull/35880#issuecomment-5185966715. I initially applied it because `SetMessageToSend()` already returns a boolean, and I treated `false` as a safe fallback in release builds while `Assume` exposed invalid callers in debug and fuzz builds. Good catch that `false` will just try again later, so a permanently invalid message would remain queued and stall the connection. I moved both size assumptions to `PushMessage()`, before the message enters the send queue. This also keeps the 4 MB application-level rule out of the transports - added you as coauthor, thanks for the review.
l0rinc (Migrated from github.com) commented 2026-08-14 19:51:31 +00:00

Pushed, let me know if I understood the request.

Pushed, let me know if I understood the request.
l0rinc commented 2026-09-06 21:05:01 +00:00 (Migrated from github.com)

AI review flagged that I was missing coverage so added PushMessage() tests because the transport tests bypassed the guard and didn’t verify rejection before queueing. Also rebased and split the type and payload characterization/fix pairs so each fix updates its own expectations (otherwise it's not obvious why multiple fixes are needed).

AI review flagged that I was missing coverage so added `PushMessage()` tests because the transport tests bypassed the guard and didn’t verify rejection before queueing. Also rebased and split the type and payload characterization/fix pairs so each fix updates its own expectations (otherwise it's not obvious why multiple fixes are needed).
naiyoma (Migrated from github.com) reviewed 2026-09-13 18:25:36 +00:00
naiyoma (Migrated from github.com) left a comment

Concept ACK

nit: Maybe it also makes sense to restrict the message type copy to MESSAGE_TYPE_SIZE?

-        std::copy(msg.m_type.begin(), msg.m_type.end(), contents.data() + 1);
+        std::copy_n(msg.m_type.begin(),
+                std::min(msg.m_type.size(), CMessageHeader::MESSAGE_TYPE_SIZE),
+                contents.data() + 1);
Concept ACK nit: Maybe it also makes sense to restrict the message type copy to `MESSAGE_TYPE_SIZE`? ```diff - std::copy(msg.m_type.begin(), msg.m_type.end(), contents.data() + 1); + std::copy_n(msg.m_type.begin(), + std::min(msg.m_type.size(), CMessageHeader::MESSAGE_TYPE_SIZE), + contents.data() + 1); ```
First-time contributor

Earlier concerns remain unresolved; see the Run archive linked from the Review report.

🟠 Minor · Private broadcast can acknowledge a TX dropped locally

With relaxed test-chain policy, private broadcast can record reception of an oversized transaction that the new send guard drops; abort-on-failed-Assume builds instead abort, and no default-configuration trigger was found.

Location: src/net.cpp:4246 (head).

🔵 Suggestion · Outbound-limit test does not require failed assumptions

Replacing Assume with a plain size check and early return would leave all assertions in outbound_message_limits passing, losing coverage of the intended debug-build failure.

Location: src/test/net_tests.cpp:1448 (head).

Review coverage was incomplete.


Reviewed: da042ca607fb · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:6a916fa059320c1e3f0a79c4f7490636461ad967153b8442c21450419af74010:24633968ff336fb935794e53e586f29b4eaaa2a15575a2c0392a2c8b9ace382c --> <!-- ralph-base:a527a0077a0fcae913188410214efe98021c0cca --> <!-- ralph-head:da042ca607fbf9df6f2d1acde8d6d29fd49583c5 --> <!-- ralph-case:feb721f047f0763119c7f6ee5f3d280cea53845a2bdf5be8b48aab28d941c64b --> Earlier concerns remain unresolved; see the Run archive linked from the Review report. **🟠 Minor · Private broadcast can acknowledge a TX dropped locally** With relaxed test-chain policy, private broadcast can record reception of an oversized transaction that the new send guard drops; abort-on-failed-Assume builds instead abort, and no default-configuration trigger was found. Location: [`src/net.cpp:4246`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/da042ca607fbf9df6f2d1acde8d6d29fd49583c5/src/net.cpp#L4246>) (head). **🔵 Suggestion · Outbound-limit test does not require failed assumptions** Replacing `Assume` with a plain size check and early return would leave all assertions in `outbound_message_limits` passing, losing coverage of the intended debug-build failure. Location: [`src/test/net_tests.cpp:1448`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/da042ca607fbf9df6f2d1acde8d6d29fd49583c5/src/test/net_tests.cpp#L1448>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`da042ca607fb`](<https://git.fish.foo/bitcoin/bitcoin/commit/da042ca607fbf9df6f2d1acde8d6d29fd49583c5>) · [Review report](<https://review.fish.foo/report/35888-da042ca607fbf9df6f2d1acde8d6d29fd49583c5-2664-5.html>) · [Previous reports](<https://review.fish.foo/traces/35888/>) [permalink](<https://review.fish.foo/report/35888-da042ca607fbf9df6f2d1acde8d6d29fd49583c5-2664-5.html>)
l0rinc commented 2026-09-29 23:24:43 +00:00 (Migrated from github.com)

Rebased and simplified the tests and fuzz setup, production fix is unchanged, with the message type added to the log.

nit: Maybe it also makes sense to restrict the message type copy

PushMessage already rejects oversized types before they reach v2, and clamping there would silently truncate an invalid type, so it's not required for this fix

Rebased and simplified the tests and fuzz setup, production fix is unchanged, with the message type added to the log. > nit: Maybe it also makes sense to restrict the message type copy `PushMessage` already rejects oversized types before they reach v2, and clamping there would silently truncate an invalid type, so it's not required for this fix
DrahtBot commented 2026-11-06 11:28:22 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
mzumsande (Migrated from github.com) reviewed 2026-11-09 17:43:36 +00:00
mzumsande (Migrated from github.com) left a comment

Looks like the Ralph finding ("With -privatebroadcast, an oversized witness variant of a mempool transaction can reach the new assumption.") is real., so the added Assume could be hit by a user.

This is probably more of a minor private broadcast bug and not a real problem because the user themselves would need to create a version of a mempool tx with its witness padded past 4 MB, and rpc is a trusted interface.

Not sure how to best fix this, if at all. Maybe privately broadcast the mempool's version of the transaction in this case, not the user-supplied one?

Looks like the Ralph finding ("With -privatebroadcast, an oversized witness variant of a mempool transaction can reach the new assumption.") is real., so the added `Assume` could be hit by a user. This is probably more of a minor private broadcast bug and not a real problem because the user themselves would need to create a version of a mempool tx with its witness padded past 4 MB, and rpc is a trusted interface. Not sure how to best fix this, if at all. Maybe privately broadcast the mempool's version of the transaction in this case, not the user-supplied one?
l0rinc commented 2026-11-13 21:22:06 +00:00 (Migrated from github.com)

Thanks mr Ralph (cc: @willcl-ark) and @mzumsande: private rebroadcast now uses the validated mempool transaction when available, with a regression test covering oversized witness variants (cc: @vasild, @andrewtoth).
I've also re-reviewed and simplified the code and tests with latest LLMs before push - removing redundant hash state, reusing the transport fixture, and sharing the fuzz setup.

Thanks mr Ralph (cc: @willcl-ark) and @mzumsande: private rebroadcast now uses the validated mempool transaction when available, with a regression test covering oversized witness variants (cc: @vasild, @andrewtoth). I've also re-reviewed and simplified the code and tests with latest LLMs before push - removing redundant hash state, reusing the transport fixture, and sharing the fuzz setup.
DrahtBot commented 2026-11-13 21:34:01 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task ASan + LSan + UBSan + integer: https://github.com/bitcoin/bitcoin/actions/runs/43509977467/job/132177388263
LLM reason (✨ experimental): The build fails because net_tests.cpp declares a constexpr std::string that Clang cannot evaluate as a constant expression.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `ASan + LSan + UBSan + integer`: https://github.com/bitcoin/bitcoin/actions/runs/43509977467/job/132177388263</sub> <sub>LLM reason (✨ experimental): The build fails because `net_tests.cpp` declares a `constexpr std::string` that Clang cannot evaluate as a constant expression.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35888
No description provided.