• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitcoindevkit / bdk / 13336408404
79%

Build:
DEFAULT BRANCH: master
Ran 14 Feb 2025 07:59PM UTC
Jobs 1
Files 52
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Feb 2025 07:51PM UTC coverage: 86.09% (+0.02%) from 86.075%
13336408404

push

github

evanlinjin
Merge bitcoindevkit/bdk#1830: Fix off-by-one error checking coinbase maturity in optional UTxOs

03b7ecaea fix(wallet): off-by-one error checking coinbase maturity in optional UTxOs (nymius)

Pull request description:

  ### Description

  As I was developing the changes in #1798 I discover issue #1810. So I introduced the fixes in that PR but later I split them in two to ease the review by suggestion of @oleonardolima .

  The `preselect_utxos` method has an off-by-one error that is making the selection of optional UTxOs too restrictive, by
  requiring the coinbase outputs to surpass or equal coinbase maturity time at the current height of the selection, and
  not in the block in which the transaction may be included in the blockchain.

  The changes in this commit fix it by considering the maturity of the coinbase output at the spending height and not
  the transaction creation height, this means, a +1 at the considered height at the moment of building the
  transaction.

  Fixes #1810.

  ### Notes to the reviewers

  Tests for issue #1810 have not been explicitly added, as there already was a `text_spend_coinbase` test which was corrected to ensure coinbase maturation is considered in alignment with the new logic.

  Changes are not breaking but I'm modifying slightly the documentation for the public method `TxBuilder::current_height` to adjust to the fixed code. Does this merit an entry in the CHANGELOG?

  ### Changelog notice

  `Wallet` now considers a utxo originated from a coinbase transaction (`coinbase utxo`) as available for selection if it will mature in the next block after the height provided to the selection, the current height by default. The previous behavior allowed selecting a `coinbase utxo` only when the height at the moment of selection was equal to maturity height or greater.

  ### Checklists

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/... (continued)

4 of 4 new or added lines in 1 file covered. (100.0%)

12143 of 14105 relevant lines covered (86.09%)

23242.81 hits per line

Jobs
ID Job ID Ran Files Coverage
1 13336408404.1 14 Feb 2025 07:59PM UTC 52
86.09
GitHub Action Run
Source Files on build 13336408404
  • Tree
  • List 52
  • Changed 15
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • a4978afe on github
  • Prev Build on master (#13264907831)
  • Next Build on master (#13420654911)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc