aboutsummaryrefslogtreecommitdiff
path: root/src/psbt.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-01-04 17:21:29 -0500
committerAndrew Chow <achow101-github@achow101.com>2021-12-10 08:29:26 -0500
commitdf84fa99c5a52e4688e240c585f7d22b20401906 (patch)
treeef13fd5d4bc921484acb223bc5cce603de38dab7 /src/psbt.h
parentc3eb416b882522dffa4254b52d2da5b53c970efe (diff)
downloadbitcoin-df84fa99c5a52e4688e240c585f7d22b20401906.tar.xz
Add GetVersion helper to PSBT
Diffstat (limited to 'src/psbt.h')
-rw-r--r--src/psbt.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/psbt.h b/src/psbt.h
index 834af26219..46cfaf5f97 100644
--- a/src/psbt.h
+++ b/src/psbt.h
@@ -405,6 +405,7 @@ struct PartiallySignedTransaction
std::optional<uint32_t> m_version;
bool IsNull() const;
+ uint32_t GetVersion() const;
/** Merge psbt into this. The two psbts must have the same underlying CTransaction (i.e. the
* same actual Bitcoin transaction.) Returns true if the merge succeeded, false otherwise. */
@@ -436,7 +437,7 @@ struct PartiallySignedTransaction
SerializeToVector(os, *tx);
// PSBT version
- if (m_version != std::nullopt && *m_version > 0) {
+ if (GetVersion() > 0) {
SerializeToVector(s, CompactSizeWriter(PSBT_GLOBAL_VERSION));
SerializeToVector(s, *m_version);
}