From d8dba3333b4970730dd8519ebb626694052cd55d Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 11 Jan 2021 17:48:30 -0500 Subject: [PATCH] Add PSBTInput::GetOutPoint Helper for getting the PSBTInput COutPoint --- src/psbt.cpp | 5 +++++ src/psbt.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/psbt.cpp b/src/psbt.cpp index ef835a89ae..c179b20c44 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -185,6 +185,11 @@ bool PSBTInput::GetUTXO(CTxOut& utxo) const return true; } +COutPoint PSBTInput::GetOutPoint() const +{ + return COutPoint(prev_txid, *prev_out); +} + bool PSBTInput::IsNull() const { return !non_witness_utxo && witness_utxo.IsNull() && partial_sigs.empty() && unknown.empty() && hd_keypaths.empty() && redeem_script.empty() && witness_script.empty(); diff --git a/src/psbt.h b/src/psbt.h index 0789e691c2..25f237cb37 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -197,6 +197,7 @@ struct PSBTInput void FromSignatureData(const SignatureData& sigdata); void Merge(const PSBTInput& input); bool GetUTXO(CTxOut& utxo) const; + COutPoint GetOutPoint() const; PSBTInput(uint32_t version) : m_psbt_version(version) {} template