Skip to content

fix(utils): wait for txins in check_txins_spent - #3743

Merged
mkoura merged 1 commit into
masterfrom
check_txins_spent_wait
Oct 6, 2026
Merged

mkoura merged 1 commit into
masterfrom
check_txins_spent_wait

Conversation

@mkoura

@mkoura mkoura commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Previously check_txins_spent waited a fixed 2 blocks and assumed the transaction was included by then. Now it checks right away and if some txins are still unspent, waits confirm_blocks new blocks and checks again, up to attempts times, like submit_tx does (without resubmitting). It also accepts TxId#TxIx strings.

Use it in places that submitted with submit_tx_bare and then waited a fixed number of blocks:

  • collateral tests wait until the collateral is spent, then report consensus_973 on timeout
  • node upgrade test waits for the inputs read from the tx file
  • defragment_utxos waits for one txin per submitted tx, which keeps the query within the command line length limit

Previously `check_txins_spent` waited a fixed 2 blocks and assumed
the transaction was included by then. Now it checks right away and
if some txins are still unspent, waits `confirm_blocks` new blocks
and checks again, up to `attempts` times, like `submit_tx` does
(without resubmitting). It also accepts `TxId#TxIx` strings.

Use it in places that submitted with `submit_tx_bare` and then
waited a fixed number of blocks:

* collateral tests wait until the collateral is spent, then report
  `consensus_973` on timeout
* node upgrade test waits for the inputs read from the tx file
* `defragment_utxos` waits for one txin per submitted tx, which
  keeps the query within the command line length limit
@mkoura
mkoura requested a review from saratomaz as a code owner October 6, 2026 12:47
@mkoura
mkoura requested a balanced review from Copilot and removed request for saratomaz October 6, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mkoura
mkoura merged commit 4da9a6d into master Oct 6, 2026
3 checks passed
@mkoura
mkoura deleted the check_txins_spent_wait branch October 6, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants