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

Crypto Exec Warns Tokenization Is Moving Faster Than Expected

Bitcoin Mining Could Be Strengthening The Ruble, Russian Central Bank Says

Nigerian SEC Partners With Police To Tackle Crypto Ponzi Schemes – Details