Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(receive): force refresh LDK on channel open #2225

Merged
merged 1 commit into from
Sep 11, 2024
Merged

fix(receive): force refresh LDK on channel open #2225

merged 1 commit into from
Sep 11, 2024

Conversation

pwltr
Copy link
Collaborator

@pwltr pwltr commented Sep 11, 2024

Description

Updating to force refreshLdk() when a channel is opened. Also makes the code around CJIT more readable and adds logs. Removing InteractionManager.runAfterInteractions lines since it doesn't do anything.

Linked Issues/Tasks

#1780

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (improving code without creating new functionality)

Tests

  • Detox test
  • Unit test
  • No test

@pwltr
Copy link
Collaborator Author

pwltr commented Sep 11, 2024

On Staging it seems to hit the fallback code with log line: LOG No CJIT entry found for funding_txid. Trying channel size.

It looks like the following code block is rarely hit, probably because BT takes longer to update the db entry than we are waiting for. I don't see this as being an issue, do you @limpbrains ?

// Try to find the CJIT entry for this channel by funding_txid.
	let cJitEntry: ICJitEntry | undefined;
	let i = 0;
	while (!cJitEntry && i < 5) {
		await sleep(1000); // wait until Blocktank has updated its database.
		await updatePendingCJitEntries();
		cJitEntry = cJitEntries.find((entry) => {
			return entry.channel?.fundingTx.id === channel.funding_txid;
		});
		i++;
	}

@limpbrains
Copy link
Collaborator

I agree it is not a big issue

@pwltr pwltr marked this pull request as ready for review September 11, 2024 12:51
@pwltr pwltr requested a review from limpbrains September 11, 2024 12:51
@pwltr
Copy link
Collaborator Author

pwltr commented Sep 11, 2024

Let's try and see if this improves it.

@pwltr pwltr merged commit 6244db7 into master Sep 11, 2024
7 checks passed
@pwltr pwltr deleted the cjit-bug branch September 11, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants