@@ -9,7 +9,7 @@ use bitcoin::hashes::hash160;
99use bitcoin:: hex:: DisplayHex ;
1010#[ cfg( not( test) ) ] // https://github.com/rust-lang/rust/issues/121684
1111use bitcoin:: secp256k1;
12- use bitcoin:: taproot;
12+ use bitcoin:: { absolute , relative , taproot} ;
1313
1414use super :: BitcoinKey ;
1515use crate :: prelude:: * ;
@@ -18,9 +18,9 @@ use crate::prelude::*;
1818#[ derive( Debug ) ]
1919pub enum Error {
2020 /// Could not satisfy, absolute locktime not met
21- AbsoluteLocktimeNotMet ( u32 ) ,
21+ AbsoluteLockTimeNotMet ( absolute :: LockTime ) ,
2222 /// Could not satisfy, lock time values are different units
23- AbsoluteLocktimeComparisonInvalid ( u32 , u32 ) ,
23+ AbsoluteLockTimeComparisonInvalid ( absolute :: LockTime , absolute :: LockTime ) ,
2424 /// Cannot Infer a taproot descriptor
2525 /// Key spends cannot infer the internal key of the descriptor
2626 /// Inferring script spends is possible, but is hidden nodes are currently
@@ -85,7 +85,9 @@ pub enum Error {
8585 /// Parse Error while parsing a `stack::Element::Push` as a XOnlyPublicKey (32 bytes)
8686 XOnlyPublicKeyParseError ,
8787 /// Could not satisfy, relative locktime not met
88- RelativeLocktimeNotMet ( u32 ) ,
88+ RelativeLockTimeNotMet ( relative:: LockTime ) ,
89+ /// Could not satisfy, the sequence number on the tx input had the disable flag set.
90+ RelativeLockTimeDisabled ( relative:: LockTime ) ,
8991 /// Forward-secp related errors
9092 Secp ( secp256k1:: Error ) ,
9193 /// Miniscript requires the entire top level script to be satisfied.
@@ -116,10 +118,10 @@ pub enum Error {
116118impl fmt:: Display for Error {
117119 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
118120 match * self {
119- Error :: AbsoluteLocktimeNotMet ( n) => {
121+ Error :: AbsoluteLockTimeNotMet ( n) => {
120122 write ! ( f, "required absolute locktime CLTV of {} blocks, not met" , n)
121123 }
122- Error :: AbsoluteLocktimeComparisonInvalid ( n, lock_time) => write ! (
124+ Error :: AbsoluteLockTimeComparisonInvalid ( n, lock_time) => write ! (
123125 f,
124126 "could not satisfy, lock time values are different units n: {} lock_time: {}" ,
125127 n, lock_time
@@ -159,9 +161,12 @@ impl fmt::Display for Error {
159161 Error :: PkHashVerifyFail ( ref hash) => write ! ( f, "Pubkey Hash check failed {}" , hash) ,
160162 Error :: PubkeyParseError => f. write_str ( "could not parse pubkey" ) ,
161163 Error :: XOnlyPublicKeyParseError => f. write_str ( "could not parse x-only pubkey" ) ,
162- Error :: RelativeLocktimeNotMet ( n) => {
164+ Error :: RelativeLockTimeNotMet ( n) => {
163165 write ! ( f, "required relative locktime CSV of {} blocks, not met" , n)
164166 }
167+ Error :: RelativeLockTimeDisabled ( n) => {
168+ write ! ( f, "required relative locktime CSV of {} blocks, but tx sequence number has disable-flag set" , n)
169+ }
165170 Error :: ScriptSatisfactionError => f. write_str ( "Top level script must be satisfied" ) ,
166171 Error :: Secp ( ref e) => fmt:: Display :: fmt ( e, f) ,
167172 Error :: SchnorrSig ( ref s) => write ! ( f, "Schnorr sig error: {}" , s) ,
@@ -188,8 +193,8 @@ impl error::Error for Error {
188193 use self :: Error :: * ;
189194
190195 match self {
191- AbsoluteLocktimeNotMet ( _)
192- | AbsoluteLocktimeComparisonInvalid ( _, _)
196+ AbsoluteLockTimeNotMet ( _)
197+ | AbsoluteLockTimeComparisonInvalid ( _, _)
193198 | CannotInferTrDescriptors
194199 | ControlBlockVerificationError
195200 | CouldNotEvaluate
@@ -212,7 +217,8 @@ impl error::Error for Error {
212217 | XOnlyPublicKeyParseError
213218 | PkEvaluationError ( _)
214219 | PkHashVerifyFail ( _)
215- | RelativeLocktimeNotMet ( _)
220+ | RelativeLockTimeNotMet ( _)
221+ | RelativeLockTimeDisabled ( _)
216222 | ScriptSatisfactionError
217223 | TapAnnexUnsupported
218224 | UncompressedPubkey
0 commit comments