@@ -9,7 +9,7 @@ use bitcoin::hashes::hash160;
9
9
use bitcoin:: hex:: DisplayHex ;
10
10
#[ cfg( not( test) ) ] // https://github.com/rust-lang/rust/issues/121684
11
11
use bitcoin:: secp256k1;
12
- use bitcoin:: taproot;
12
+ use bitcoin:: { absolute , relative , taproot} ;
13
13
14
14
use super :: BitcoinKey ;
15
15
use crate :: prelude:: * ;
@@ -18,9 +18,9 @@ use crate::prelude::*;
18
18
#[ derive( Debug ) ]
19
19
pub enum Error {
20
20
/// Could not satisfy, absolute locktime not met
21
- AbsoluteLocktimeNotMet ( u32 ) ,
21
+ AbsoluteLocktimeNotMet ( absolute :: LockTime ) ,
22
22
/// Could not satisfy, lock time values are different units
23
- AbsoluteLocktimeComparisonInvalid ( u32 , u32 ) ,
23
+ AbsoluteLocktimeComparisonInvalid ( absolute :: LockTime , absolute :: LockTime ) ,
24
24
/// Cannot Infer a taproot descriptor
25
25
/// Key spends cannot infer the internal key of the descriptor
26
26
/// Inferring script spends is possible, but is hidden nodes are currently
@@ -85,7 +85,9 @@ pub enum Error {
85
85
/// Parse Error while parsing a `stack::Element::Push` as a XOnlyPublicKey (32 bytes)
86
86
XOnlyPublicKeyParseError ,
87
87
/// 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 ) ,
89
91
/// Forward-secp related errors
90
92
Secp ( secp256k1:: Error ) ,
91
93
/// Miniscript requires the entire top level script to be satisfied.
@@ -162,6 +164,9 @@ impl fmt::Display for Error {
162
164
Error :: RelativeLocktimeNotMet ( n) => {
163
165
write ! ( f, "required relative locktime CSV of {} blocks, not met" , n)
164
166
}
167
+ Error :: RelativeLocktimeDisabled ( n) => {
168
+ write ! ( f, "required relative locktime CSV of {} blocks, but tx sequence number has disable-flag set" , n)
169
+ }
165
170
Error :: ScriptSatisfactionError => f. write_str ( "Top level script must be satisfied" ) ,
166
171
Error :: Secp ( ref e) => fmt:: Display :: fmt ( e, f) ,
167
172
Error :: SchnorrSig ( ref s) => write ! ( f, "Schnorr sig error: {}" , s) ,
@@ -213,6 +218,7 @@ impl error::Error for Error {
213
218
| PkEvaluationError ( _)
214
219
| PkHashVerifyFail ( _)
215
220
| RelativeLocktimeNotMet ( _)
221
+ | RelativeLocktimeDisabled ( _)
216
222
| ScriptSatisfactionError
217
223
| TapAnnexUnsupported
218
224
| UncompressedPubkey
0 commit comments