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