-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: master
Are you sure you want to change the base?
Bump 111 #56
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what?
There was a problem hiding this comment.
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")), |
There was a problem hiding this comment.
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?
Sorry for the delay, was waiting on 0.0.115.1, which is now on Maven and an Android AAR on the release page. |
No description provided.