File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -893,10 +893,11 @@ impl Channel {
893
893
894
894
/// Gets the redeemscript for the funding transaction output (ie the funding transaction output
895
895
/// pays to get_funding_redeemscript().to_v0_p2wsh()).
896
+ /// Panics if called before accept_channel/new_from_req
896
897
pub fn get_funding_redeemscript ( & self ) -> Script {
897
898
let builder = Builder :: new ( ) . push_opcode ( opcodes:: All :: OP_PUSHNUM_2 ) ;
898
899
let our_funding_key = PublicKey :: from_secret_key ( & self . secp_ctx , & self . local_keys . funding_key ) . serialize ( ) ;
899
- let their_funding_key = self . their_funding_pubkey . unwrap ( ) . serialize ( ) ;
900
+ let their_funding_key = self . their_funding_pubkey . expect ( "get_funding_redeemscript only allowed after accept_channel" ) . serialize ( ) ;
900
901
if our_funding_key[ ..] < their_funding_key[ ..] {
901
902
builder. push_slice ( & our_funding_key)
902
903
. push_slice ( & their_funding_key)
You can’t perform that action at this time.
0 commit comments