@@ -161,7 +161,7 @@ pub enum SpendableOutputDescriptor {
161161 ///
162162 /// To derive the revocation_pubkey provided here (which is used in the witness
163163 /// script generation), you must pass the counterparty revocation_basepoint (which appears in the
164- /// call to Sign::ready_channel ) and the provided per_commitment point
164+ /// call to Sign::provide_channel_parameters ) and the provided per_commitment point
165165 /// to chan_utils::derive_public_revocation_key.
166166 ///
167167 /// The witness script which is hashed and included in the output script_pubkey may be
@@ -368,16 +368,17 @@ pub trait BaseSign {
368368 -> Result < ( Signature , Signature ) , ( ) > ;
369369
370370 /// Set the counterparty static channel data, including basepoints,
371- /// counterparty_selected/holder_selected_contest_delay and funding outpoint.
372- /// This is done as soon as the funding outpoint is known. Since these are static channel data,
373- /// they MUST NOT be allowed to change to different values once set.
371+ /// counterparty_selected/holder_selected_contest_delay and funding outpoint. This is only
372+ /// called once either immediately upon signer derivation, or if the channel has yet to be
373+ /// funded, as soon as the funding outpoint is known. Since these are static channel data, they
374+ /// MUST NOT be allowed to change to different values once set.
374375 ///
375376 /// channel_parameters.is_populated() MUST be true.
376377 ///
377378 /// We bind holder_selected_contest_delay late here for API convenience.
378379 ///
379380 /// Will be called before any signatures are applied.
380- fn ready_channel ( & mut self , channel_parameters : & ChannelTransactionParameters ) ;
381+ fn provide_channel_parameters ( & mut self , channel_parameters : & ChannelTransactionParameters ) ;
381382}
382383
383384/// A cloneable signer.
@@ -583,39 +584,39 @@ impl InMemorySigner {
583584 }
584585
585586 /// Counterparty pubkeys.
586- /// Will panic if ready_channel wasn't called.
587+ /// Will panic if provide_channel_parameters wasn't called.
587588 pub fn counterparty_pubkeys ( & self ) -> & ChannelPublicKeys { & self . get_channel_parameters ( ) . counterparty_parameters . as_ref ( ) . unwrap ( ) . pubkeys }
588589
589590 /// The contest_delay value specified by our counterparty and applied on holder-broadcastable
590591 /// transactions, ie the amount of time that we have to wait to recover our funds if we
591592 /// broadcast a transaction.
592- /// Will panic if ready_channel wasn't called.
593+ /// Will panic if provide_channel_parameters wasn't called.
593594 pub fn counterparty_selected_contest_delay ( & self ) -> u16 { self . get_channel_parameters ( ) . counterparty_parameters . as_ref ( ) . unwrap ( ) . selected_contest_delay }
594595
595596 /// The contest_delay value specified by us and applied on transactions broadcastable
596597 /// by our counterparty, ie the amount of time that they have to wait to recover their funds
597598 /// if they broadcast a transaction.
598- /// Will panic if ready_channel wasn't called.
599+ /// Will panic if provide_channel_parameters wasn't called.
599600 pub fn holder_selected_contest_delay ( & self ) -> u16 { self . get_channel_parameters ( ) . holder_selected_contest_delay }
600601
601602 /// Whether the holder is the initiator
602- /// Will panic if ready_channel wasn't called.
603+ /// Will panic if provide_channel_parameters wasn't called.
603604 pub fn is_outbound ( & self ) -> bool { self . get_channel_parameters ( ) . is_outbound_from_holder }
604605
605606 /// Funding outpoint
606- /// Will panic if ready_channel wasn't called.
607+ /// Will panic if provide_channel_parameters wasn't called.
607608 pub fn funding_outpoint ( & self ) -> & OutPoint { self . get_channel_parameters ( ) . funding_outpoint . as_ref ( ) . unwrap ( ) }
608609
609610 /// Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
610611 /// building transactions.
611612 ///
612- /// Will panic if ready_channel wasn't called.
613+ /// Will panic if provide_channel_parameters wasn't called.
613614 pub fn get_channel_parameters ( & self ) -> & ChannelTransactionParameters {
614615 self . channel_parameters . as_ref ( ) . unwrap ( )
615616 }
616617
617618 /// Whether anchors should be used.
618- /// Will panic if ready_channel wasn't called.
619+ /// Will panic if provide_channel_parameters wasn't called.
619620 pub fn opt_anchors ( & self ) -> bool {
620621 self . get_channel_parameters ( ) . opt_anchors . is_some ( )
621622 }
@@ -819,7 +820,7 @@ impl BaseSign for InMemorySigner {
819820 Ok ( ( sign ( secp_ctx, & msghash, & self . node_secret ) , sign ( secp_ctx, & msghash, & self . funding_key ) ) )
820821 }
821822
822- fn ready_channel ( & mut self , channel_parameters : & ChannelTransactionParameters ) {
823+ fn provide_channel_parameters ( & mut self , channel_parameters : & ChannelTransactionParameters ) {
823824 assert ! ( self . channel_parameters. is_none( ) , "Acceptance already noted" ) ;
824825 assert ! ( channel_parameters. is_populated( ) , "Channel parameters must be fully populated" ) ;
825826 self . channel_parameters = Some ( channel_parameters. clone ( ) ) ;
0 commit comments