@@ -21,7 +21,7 @@ import org.ldk.structs.Result_ChannelIdAPIErrorZ.Result_ChannelIdAPIErrorZ_OK
2121import org.ldk.structs.Result_NoneAPIErrorZ.Result_NoneAPIErrorZ_OK
2222import org.ldk.structs.Result_NoneRetryableSendFailureZ.Result_NoneRetryableSendFailureZ_Err
2323import org.ldk.structs.Result_PublicKeyNoneZ.Result_PublicKeyNoneZ_OK
24- import org.ldk.structs.Result_StrSecp256k1ErrorZ.Result_StrSecp256k1ErrorZ_OK
24+ // import org.ldk.structs.Result_StrSecp256k1ErrorZ.Result_StrSecp256k1ErrorZ_OK
2525import org.ldk.util.UInt128
2626import java.io.File
2727import java.net.InetSocketAddress
@@ -592,8 +592,27 @@ class LdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMod
592592 // MARK: Update methods
593593
594594 @ReactMethod
595- fun updateFees (anchorChannelFee : Double , nonAnchorChannelFee : Double , channelCloseMinimum : Double , minAllowedAnchorChannelRemoteFee : Double , onChainSweep : Double , minAllowedNonAnchorChannelRemoteFee : Double , outputSpendingFee : Double , promise : Promise ) {
596- feeEstimator.update(anchorChannelFee.toInt(), nonAnchorChannelFee.toInt(), channelCloseMinimum.toInt(), minAllowedAnchorChannelRemoteFee.toInt(), onChainSweep.toInt(), minAllowedNonAnchorChannelRemoteFee.toInt(), outputSpendingFee.toInt())
595+ fun updateFees (
596+ anchorChannelFee : Double ,
597+ nonAnchorChannelFee : Double ,
598+ channelCloseMinimum : Double ,
599+ minAllowedAnchorChannelRemoteFee : Double ,
600+ minAllowedNonAnchorChannelRemoteFee : Double ,
601+ outputSpendingFee : Double ,
602+ maximumFeeEstimate : Double ,
603+ urgentOnChainSweep : Double ,
604+ promise : Promise
605+ ) {
606+ feeEstimator.update(
607+ anchorChannelFee.toInt(),
608+ nonAnchorChannelFee.toInt(),
609+ channelCloseMinimum.toInt(),
610+ minAllowedAnchorChannelRemoteFee.toInt(),
611+ minAllowedNonAnchorChannelRemoteFee.toInt(),
612+ outputSpendingFee.toInt(),
613+ maximumFeeEstimate.toInt(),
614+ urgentOnChainSweep.toInt(),
615+ )
597616 handleResolve(promise, LdkCallbackResponses .fees_updated)
598617 }
599618
@@ -761,7 +780,7 @@ class LdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMod
761780 channelManager ? : return handleReject(promise, LdkErrors .init_channel_manager)
762781
763782 val channelIdObj = ChannelId .of(channelId.hexa())
764- val res = if (force) channelManager!! .force_close_broadcasting_latest_txn(channelIdObj, counterpartyNodeId.hexa()) else channelManager!! .close_channel(channelIdObj, counterpartyNodeId.hexa())
783+ val res = if (force) channelManager!! .force_close_broadcasting_latest_txn(channelIdObj, counterpartyNodeId.hexa(), " Force close " ) else channelManager!! .close_channel(channelIdObj, counterpartyNodeId.hexa())
765784 if (! res.is_ok) {
766785 return handleReject(promise, LdkErrors .channel_close_fail)
767786 }
@@ -846,9 +865,9 @@ class LdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMod
846865 channelManager ? : return handleReject(promise, LdkErrors .init_channel_manager)
847866
848867 if (broadcastLatestTx) {
849- channelManager!! .force_close_all_channels_broadcasting_latest_txn()
868+ channelManager!! .force_close_all_channels_broadcasting_latest_txn(" Force close broadcasting latest tx " )
850869 } else {
851- channelManager!! .force_close_all_channels_without_broadcasting_txn()
870+ channelManager!! .force_close_all_channels_without_broadcasting_txn(" Force close without broadcasting latest tx " )
852871 }
853872
854873 handleResolve(promise, LdkCallbackResponses .close_channel_success)
@@ -1353,15 +1372,15 @@ class LdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMod
13531372 descriptors,
13541373 emptyArray(),
13551374 changeDestinationScript.hexa(),
1356- feeEstimator.onChainSweep ,
1375+ feeEstimator.urgentOnChainSweep ,
13571376 Option_u32Z .none()
13581377 )
13591378 } else {
13601379 keysManager!! .spend_spendable_outputs(
13611380 descriptors,
13621381 emptyArray(),
13631382 changeDestinationScript.hexa(),
1364- feeEstimator.onChainSweep ,
1383+ feeEstimator.urgentOnChainSweep ,
13651384 Option_u32Z .none()
13661385 )
13671386 }
@@ -1381,13 +1400,7 @@ class LdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMod
13811400 fun nodeSign (message : String , promise : Promise ) {
13821401 keysManager ? : return handleReject(promise, LdkErrors .init_keys_manager)
13831402
1384- val res = UtilMethods .sign(message.toByteArray(Charsets .UTF_8 ), keysManager!! .inner._node_secret_key )
1385-
1386- if (! res.is_ok) {
1387- return handleReject(promise, LdkErrors .failed_signing_request)
1388- }
1389-
1390- promise.resolve((res as Result_StrSecp256k1ErrorZ_OK ).res)
1403+ promise.resolve(UtilMethods .sign(message.toByteArray(Charsets .UTF_8 ), keysManager!! .inner._node_secret_key ))
13911404 }
13921405
13931406 @ReactMethod
0 commit comments