Skip to content

Conversation

@OBorce
Copy link
Contributor

@OBorce OBorce commented Sep 16, 2025

New endpoint in API server to get a single transaction output and its spent state.

Comment on lines +584 to +585
let utxo = db_tx
.get_utxo(outpoint)
Copy link
Contributor

Choose a reason for hiding this comment

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

I must say I was surprised to find out that get_utxo actually returns any txos, not just unspent ones.
Perhaps we should add a TODO somewhere to revamp the naming, both in the code and in the db?

P.S. Also, struct Utxo is not a utxo, but struct LockedUtxo is, it seems.
And in the db ml.utxo contains any txos, even spent ones, while ml.locked_utxo seems to contain only unspent txos indeed.
This is very confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess the names should be changed.
both utxo and locked_utxo have both spent and unspent, nothing in the tables is ever deleted only inserted.
locked_utxo table is just to truck the unlock periods.

@OBorce OBorce merged commit b118b3b into master Sep 18, 2025
28 checks passed
@OBorce OBorce deleted the feature/api-server-tx-output branch September 18, 2025 16:33
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.

3 participants