What is the best way to check using bitcoin core RPC if a transaction is re-orged?

My current approach is to check the following:

fn is_orphaned(..) {
    let res = get_raw_transaction(txid)
    return confirmations == 0 && blockhash != null
}

Is the above way correct? And is there a more direct way of checking whether a transaction is re-orged? I am running bitcoin core with txindex = 1



from Recent Questions - Bitcoin Stack Exchange https://ift.tt/o68uCzT
via IFTTT

Popular posts from this blog

Bitwise Clients Pour $69M Into Solana as Bulls Fight to Reclaim $200 Resistance Zone

The XRP Roadmap: Ripple President Reveals The Next Big Steps

Here’s When The First Dogecoin ETF Is Expected To Go Live – It’s Soon