trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
679 stars 246 forks source link

Regtest account cannot spend Coinbase Transaction #10315

Open peter-sanderson opened 7 months ago

peter-sanderson commented 7 months ago

Describe the bug When I mine a block on regtest (using Trezor Emulator - the trezor-user-env), the 25 coins that are a block reward cannot be spend.

Info:

How to reproduce Steps to reproduce the behavior:

  1. Start trezor-user-env, start Bridge, start bridge Trezor T
  2. Load testing seed
  3. Enable debug in Suite
  4. Add Regtest
  5. Get receive address and mine Regtest block to it from the trezor-user-env
    image
  6. Get another receive address and try send coins to it
  7. There is an error

Expected behavior It shall be possible to sand amound <= 25 coins

Screenshots image

Additional context It works with coins that are just send from Regtest account. image

szymonlesisz commented 7 months ago

coinbase input can be spent after 100 confirmations

i dont exactly remember the reason, but it's like that since forever :)

edit: the reason is this:

Coinbase UTXOs have this field set to true, however, due to performance reasons, it will return only
up to the minimum Coinbase confirmations limit (100). 
After this limit, UTXOs are not detected as Coinbase.
peter-sanderson commented 6 months ago

@szymonlesisz thanks!

It would be good to have it somehow communicated in the UI. This must be a problem for all coinbase transactions.

Filtering happens here: packages/utxo-lib/src/coinselect/coinselectUtils.ts in the filterCoinbase method.