Add Reserved variant to SigHashType for future use (ie SIGHASH_ANYPREVOUT)

This commit is contained in:
Riccardo Casatta 2021-07-16 10:51:11 +02:00
parent 53d0e176d3
commit 1a7afed068
No known key found for this signature in database
GPG Key ID: FD986A969E450397
1 changed files with 4 additions and 0 deletions

View File

@ -113,6 +113,9 @@ pub enum SigHashType {
NonePlusAnyoneCanPay = 0x82,
/// 0x83: Sign one output and only this input (see `Single` for what "one output" means)
SinglePlusAnyoneCanPay = 0x83,
/// Reserved for future use
Reserved = 0xFF,
}
/// Possible errors in computing the signature message
@ -225,6 +228,7 @@ impl SigHashType {
SigHashType::AllPlusAnyoneCanPay => (SigHashType::All, true),
SigHashType::NonePlusAnyoneCanPay => (SigHashType::None, true),
SigHashType::SinglePlusAnyoneCanPay => (SigHashType::Single, true),
SigHashType::Reserved => (SigHashType::Reserved, false),
}
}
}