@@ -7967,11 +7967,32 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
7967
7967
/// Indicates that the signer may have some signatures for us, so we should retry if we're
7968
7968
/// blocked.
7969
7969
#[cfg(async_signing)]
7970
- pub fn signer_maybe_unblocked<L: Deref>(&mut self, logger: &L) -> Option<msgs::FundingCreated> where L::Target: Logger {
7971
- if self.context.signer_pending_funding && self.context.is_outbound() {
7972
- log_trace!(logger, "Signer unblocked a funding_created");
7970
+ pub fn signer_maybe_unblocked<L: Deref>(&mut self, chain_hash: ChainHash, logger: &L) -> (Option<msgs::OpenChannel>, Option<msgs::FundingCreated>)
7971
+ where L::Target: Logger
7972
+ {
7973
+ // If we were pending a commitment point, retry the signer and advance to an
7974
+ // available state.
7975
+ if self.unfunded_context.holder_commitment_point.is_none() {
7976
+ self.unfunded_context.holder_commitment_point = HolderCommitmentPoint::new(&self.context.holder_signer, &self.context.secp_ctx);
7977
+ }
7978
+ if let Some(ref mut point) = self.unfunded_context.holder_commitment_point {
7979
+ if !point.is_available() {
7980
+ point.try_resolve_pending(&self.context.holder_signer, &self.context.secp_ctx, logger);
7981
+ }
7982
+ }
7983
+ let open_channel = match self.unfunded_context.holder_commitment_point {
7984
+ Some(ref mut point) if point.is_available() && self.signer_pending_open_channel => {
7985
+ log_trace!(logger, "Attempting to generate open_channel...");
7986
+ self.get_open_channel(chain_hash, logger)
7987
+ }
7988
+ _ => None
7989
+ };
7990
+ let funding_created = if self.context.signer_pending_funding && self.context.is_outbound() {
7991
+ log_trace!(logger, "Attempting to generate pending funding created...");
7992
+ self.context.signer_pending_funding = false;
7973
7993
self.get_funding_created_msg(logger)
7974
- } else { None }
7994
+ } else { None };
7995
+ (open_channel, funding_created)
7975
7996
}
7976
7997
}
7977
7998
0 commit comments