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

Bump 111 #56

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Bump 111 #56

wants to merge 8 commits into from

Conversation

Overtorment
Copy link
Member

No description provided.

Copy link
Contributor

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took me so long to get to. Java side looks mostly fine, didn't look at the ios end.

}
} else {
// first run, creating from scratch
println("ReactNativeLDK: network graph first run, creating from scratch")
router = NetworkGraph.of(hexStringToByteArray("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f").reversedArray(), logger)
router = NetworkGraph.of(Network.LDKNetwork_Bitcoin, logger)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to drop the graph and scorer construction/deserialization code here entirely. Let the CMC handle it for you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would the fix look like?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having this whole block of code and then later doing router!!.write() you can simply read the file into serialized_graph as done already and pass it to ChannelManagerConstructor. Similar for the ProbabilisticScorer which is done next - ie the entire blocks of code between initialize graph sync and INITIALIZE THE CHANNELMANAGER (and just keep the file reads).

fee_estimator,
chain_monitor,
tx_filter,
router!!.write(),
org.ldk.structs.ProbabilisticScoringParameters.with_default(),
scorer?.write(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gonna create two graphs/scorers in memory which will be confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you elaborate? what was done wrong here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we just do #56 (comment) this will be removed and we'll just use the one created in the CMC :)

@@ -893,8 +908,16 @@ class RnLdkModule(private val reactContext: ReactApplicationContext) : ReactCont
println("ReactNativeLDK: ContentiousClaimable = " + it.claimable_amount_satoshis + " " + it.timeout_height);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should count as balance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These funds are funds we expect to receive, so we should probably increment totalSat by them :).

@@ -440,9 +447,9 @@ class RnLdkModule(private val reactContext: ReactApplicationContext) : ReactCont
path = path.plusElement(
RouteHop.of(
hexStringToByteArray(hopJson.getString("pubkey")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to use https://github.com/lightningdevkit/ldk-garbagecollected/blob/main/src/main/java/org/ldk/structs/UtilMethods.java#L539 now, though it requires a network graph, which IIRC this method wanted to avoid?

@TheBlueMatt
Copy link
Contributor

Sorry for the delay, was waiting on 0.0.115.1, which is now on Maven and an Android AAR on the release page.

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.

3 participants