aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/scriptpubkeyman.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-11-15 13:54:01 -0500
committerAndrew Chow <achow101-github@achow101.com>2021-12-08 09:43:26 -0500
commiteb9a1a2c595a03475fd4275b104676b7e2200f07 (patch)
treee0677f33d40f91c2ecd55e1bc90ac7d98fe5942c /src/wallet/scriptpubkeyman.cpp
parent577bd51a4b8de066466a445192c1c653872657e2 (diff)
downloadbitcoin-eb9a1a2c595a03475fd4275b104676b7e2200f07.tar.xz
psbt: Make sighash_type std::optional<int>
It is better to ues an optional to determine whether the sighash type is set rather than using 0 as a magic number.
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r--src/wallet/scriptpubkeyman.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp
index 1769429efe..a9e2624188 100644
--- a/src/wallet/scriptpubkeyman.cpp
+++ b/src/wallet/scriptpubkeyman.cpp
@@ -633,7 +633,7 @@ TransactionError LegacyScriptPubKeyMan::FillPSBT(PartiallySignedTransaction& psb
}
// Get the Sighash type
- if (sign && input.sighash_type > 0 && input.sighash_type != sighash_type) {
+ if (sign && input.sighash_type != std::nullopt && *input.sighash_type != sighash_type) {
return TransactionError::SIGHASH_MISMATCH;
}
@@ -2114,7 +2114,7 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction&
}
// Get the Sighash type
- if (sign && input.sighash_type > 0 && input.sighash_type != sighash_type) {
+ if (sign && input.sighash_type != std::nullopt && *input.sighash_type != sighash_type) {
return TransactionError::SIGHASH_MISMATCH;
}