Merge rust-bitcoin/rust-bitcoin#2294: Deprecate `Script::is_provably_unspendable`
089ce8f0fb
Deprecate `Script::is_provably_unspendable` (Martin Habovstiak) Pull request description: This method is not really that useful because it checked an arbitrary condition. There already exists `OP_RETURN` semantics and the method didn't cover all possible ways the script may be invalid. This deprecates the method and documents why. Closes #2191 ACKs for top commit: apoelstra: ACK089ce8f0fb
tcharding: ACK089ce8f0fb
sanket1729: ACK089ce8f0fb
Tree-SHA512: 044f1c06fb8cbea4f84817be41bf10315f690b2a42748a07c1dd1eb0ba10932456780956fc628fec4bf57fe0722129537874a77be482d6660f9e02de5fc5a8a0
This commit is contained in:
commit
6aaaae6ffc
|
@ -353,7 +353,11 @@ impl Script {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks whether a script can be proven to have no satisfying input.
|
/// Checks whether a script is trivially known to have no satisfying input.
|
||||||
|
///
|
||||||
|
/// This method has potentially confusing semantics and an unclear purpose, so it's going to be
|
||||||
|
/// removed. Use `is_op_return` if you want `OP_RETURN` semantics.
|
||||||
|
#[deprecated(since = "TBD", note = "The method is not very useful, you might want `is_op_return`")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_provably_unspendable(&self) -> bool {
|
pub fn is_provably_unspendable(&self) -> bool {
|
||||||
use crate::blockdata::opcodes::Class::{IllegalOp, ReturnOp};
|
use crate::blockdata::opcodes::Class::{IllegalOp, ReturnOp};
|
||||||
|
|
Loading…
Reference in New Issue