diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index bbcf732b5e..a167b481a1 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -325,6 +325,16 @@ impl Script { opcodes::All::from(self.0[0]).classify() == opcodes::Class::IllegalOp) } + /// Gets the minimum value an output with this script should have in order to be + /// broadcastable on today's bitcoin network. + pub fn dust_value() { + if self.is_witness_program() { + 294 + } else { + 546 + } + } + /// Iterate over the script in the form of `Instruction`s, which are an enum covering /// opcodes, datapushes and errors. At most one error will be returned and then the /// iterator will end. To instead iterate over the script as sequence of bytes, treat