test: Add coverage for unsatisfiable locktime combination in PSBT `ComputeTimeLock()` #36163

pull nebula-21 wants to merge 1 commits into bitcoin:master from nebula-21:add-checktimelock-coverage changing 1 files +1 −0
  1. nebula-21 commented at 3:15 PM on September 3, 2026: contributor

    This PR adds a test case to psbt2_timelock_test covering an unsatisfiable locktime combination in PartiallySignedTransaction::ComputeTimeLock().

    When different PSBT v2 inputs specify their own timelock requirement, ComputeTimeLock() needs to reconcile all of those into a single locktime for the whole transaction. To reconcile this locktime, all the inputs locktimes need to be height or time-based, but not a mix of them.

    The existing test already covers this failure when the input #0 is height-based and a later input is time-based, returning std::nullopt. This PR adds the other case when the input #0 is time-based and a later input is height-based, returning std::nullopt. I've basically swapped the PSBT inputs from the already existing case to cover this one.

  2. test: Add coverage for unsatisfiable locktime combination in PSBT ComputeTimeLock 69a640e05e
  3. DrahtBot added the label Tests on Sep 3, 2026
  4. DrahtBot commented at 3:15 PM on September 3, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36163.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK sedited

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited approved
  6. sedited commented at 11:56 AM on September 5, 2026: contributor

    ACK 69a640e05ec072c8bdce8d52dfd982df274e8262

    Seems fine to add a bit coverage.

  7. sedited merged this on Sep 5, 2026
  8. sedited closed this on Sep 5, 2026

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-09 07:56 UTC