mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
psbt: Check sighash types in SignPSBTInput and take sighash as optional
This commit is contained in:
@@ -378,10 +378,10 @@ UniValue DescribeAddress(const CTxDestination& dest)
|
||||
*
|
||||
* @pre The sighash argument should be string or null.
|
||||
*/
|
||||
int ParseSighashString(const UniValue& sighash)
|
||||
std::optional<int> ParseSighashString(const UniValue& sighash)
|
||||
{
|
||||
if (sighash.isNull()) {
|
||||
return SIGHASH_DEFAULT;
|
||||
return std::nullopt;
|
||||
}
|
||||
const auto result{SighashFromStr(sighash.get_str())};
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user