diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-11-15 13:54:01 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-12-08 09:43:26 -0500 |
commit | eb9a1a2c595a03475fd4275b104676b7e2200f07 (patch) | |
tree | e0677f33d40f91c2ecd55e1bc90ac7d98fe5942c /src/rpc/rawtransaction.cpp | |
parent | 577bd51a4b8de066466a445192c1c653872657e2 (diff) |
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/rpc/rawtransaction.cpp')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index a3583e7f12..713b0afcdc 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1255,8 +1255,8 @@ static RPCHelpMan decodepsbt() } // Sighash - if (input.sighash_type > 0) { - in.pushKV("sighash", SighashToStr((unsigned char)input.sighash_type)); + if (input.sighash_type != std::nullopt) { + in.pushKV("sighash", SighashToStr((unsigned char)*input.sighash_type)); } // Redeem script and witness script |