mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user