spesmilo / spesmilo/electrum

sweep() does not check UTXOs for maturity

Open
#3,124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.6k
Forks
3.5k
Avg merge
2d 8h
Merged PRs (30d)
61

Description

When sweeping private keys, Electrum does not check coin maturity.

Something along the lines of

if self.utxo_is_coinbase(item) and item['height'] + COINBASE_MATURITY - 1 > self.get_local_height():
    continue

should be done. Not sure how best to implement utxo_is_coinbase().

I guess this probably doesn't affect many people.

sweep_coin_maturity

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the sweep() implementation and trace how each UTXO is identified, including where coinbase status and local height are available. Confirm how COINBASE_MATURITY should be applied, then verify that immature coinbase outputs are skipped while mature outputs remain sweepable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.