X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fscript.rs;h=595085114b0cdec9ee5e2988fa869f5a264eef35;hb=f76f60ff855ff286fc5c71704ea74430cdfb7d86;hp=7abe3060fa7b666f22fc83048ca330a194e3fdfb;hpb=65920818db58880f6576fd50c3ea5df273912978;p=rust-lightning diff --git a/lightning/src/ln/script.rs b/lightning/src/ln/script.rs index 7abe3060..59508511 100644 --- a/lightning/src/ln/script.rs +++ b/lightning/src/ln/script.rs @@ -16,7 +16,7 @@ use io; /// A script pubkey for shutting down a channel as defined by [BOLT #2]. /// -/// [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md +/// [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md #[derive(Clone, PartialEq)] pub struct ShutdownScript(ShutdownScriptImpl); @@ -25,7 +25,7 @@ pub struct ShutdownScript(ShutdownScriptImpl); pub struct InvalidShutdownScript { /// The script that did not meet the requirements from [BOLT #2]. /// - /// [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + /// [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md pub script: Script } @@ -122,7 +122,7 @@ pub(crate) fn is_bolt2_compliant(script: &Script, features: &InitFeatures) -> bo if script.is_p2pkh() || script.is_p2sh() || script.is_v0_p2wpkh() || script.is_v0_p2wsh() { true } else if features.supports_shutdown_anysegwit() { - script.is_witness_program() && script.as_bytes()[0] != SEGWIT_V0.into_u8() + script.is_witness_program() && script.as_bytes()[0] != SEGWIT_V0.to_u8() } else { false }