Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add new blockhash and confirmations fields to Utxo struct #366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luisschwab
Copy link

@luisschwab luisschwab commented Jul 29, 2024

As per PR #30515 on Bitcoin Core, two new fields are added on the output of scantxoutset for versions v28 and above:

  • blockhash: blockhash of the UTXO,
  • confirmations: number of confirmations of the UTXO.

This PR adds these two new fields on the Utxo struct as an Option, since not all clients will be running v28:

pub struct Utxo {
    pub txid: bitcoin::Txid,
    pub vout: u32,
    pub script_pub_key: bitcoin::ScriptBuf,
    #[serde(rename = "desc")]
    pub descriptor: String,
    #[serde(with = "bitcoin::amount::serde::as_btc")]
    pub amount: bitcoin::Amount,
    pub height: u64,
+   pub blockhash: Option<bitcoin::BlockHash>,
+   pub confirmations: Option<u64>,
}

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.

1 participant