@@ -18,7 +18,7 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler {
1818 override fun handle_event (event : Event ) {
1919 (event as ? Event .FundingGenerationReady )?.let { fundingGenerationReady ->
2020 val body = Arguments .createMap()
21- body.putHexString(" temp_channel_id" , fundingGenerationReady.temporary_channel_id)
21+ body.putHexString(" temp_channel_id" , fundingGenerationReady.temporary_channel_id. _a )
2222 body.putHexString(" output_script" , fundingGenerationReady.output_script)
2323 body.putString(" user_channel_id" , fundingGenerationReady.user_channel_id.leBytes.hexEncodedString())
2424 body.putInt(" value_satoshis" , fundingGenerationReady.channel_value_satoshis.toInt())
@@ -29,7 +29,7 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler {
2929 val body = Arguments .createMap()
3030 body.putHexString(" payment_hash" , paymentClaimable.payment_hash)
3131 body.putInt(" amount_sat" , paymentClaimable.amount_msat.toInt() / 1000 )
32- (paymentClaimable.purpose as ? PaymentPurpose .InvoicePayment )?.let {
32+ (paymentClaimable.purpose as ? PaymentPurpose .Bolt11InvoicePayment )?.let {
3333 body.putHexString(" payment_preimage" , (it.payment_preimage as Option_ThirtyTwoBytesZ .Some ).some)
3434 body.putHexString(" payment_secret" , it.payment_secret)
3535 }
@@ -60,7 +60,7 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler {
6060 (event as ? Event .OpenChannelRequest )?.let { openChannelRequest ->
6161 // Use if we ever manually accept inbound channels. Setting in initConfig.
6262 val body = Arguments .createMap()
63- body.putHexString(" temp_channel_id" , openChannelRequest.temporary_channel_id)
63+ body.putHexString(" temp_channel_id" , openChannelRequest.temporary_channel_id. _a )
6464 body.putHexString(" counterparty_node_id" , openChannelRequest.counterparty_node_id)
6565 body.putInt(" push_sat" , openChannelRequest.push_msat.toInt() / 1000 )
6666 body.putInt(" funding_satoshis" , openChannelRequest.funding_satoshis.toInt())
@@ -143,10 +143,9 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler {
143143 (event as ? Event .ChannelClosed )?.let { channelClosed ->
144144 val body = Arguments .createMap()
145145 body.putString(" user_channel_id" , channelClosed.user_channel_id.leBytes.hexEncodedString())
146- body.putHexString(" channel_id" , channelClosed.channel_id)
146+ body.putHexString(" channel_id" , channelClosed.channel_id. _a )
147147 val reasonString = when (channelClosed.reason) {
148148 is ClosureReason .CommitmentTxConfirmed -> " CommitmentTxConfirmed"
149- is ClosureReason .CooperativeClosure -> " CooperativeClosure"
150149 is ClosureReason .CounterpartyCoopClosedUnfundedChannel -> " CounterpartyCoopClosedUnfundedChannel"
151150 is ClosureReason .CounterpartyForceClosed -> " CounterpartyForceClosed"
152151 is ClosureReason .DisconnectedPeer -> " DisconnectedPeer"
@@ -155,6 +154,10 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler {
155154 is ClosureReason .HolderForceClosed -> " HolderForceClosed"
156155 is ClosureReason .OutdatedChannelManager -> " OutdatedChannelManager"
157156 is ClosureReason .ProcessingError -> " ProcessingError"
157+ is ClosureReason .CounterpartyInitiatedCooperativeClosure -> " CounterpartyInitiatedCooperativeClosure"
158+ is ClosureReason .LegacyCooperativeClosure -> " LegacyCooperativeClosure"
159+ is ClosureReason .LocallyInitiatedCooperativeClosure -> " LocallyInitiatedCooperativeClosure"
160+ is ClosureReason .HTLCsTimedOut -> " HTLCsTimedOut"
158161 else -> " Unknown"
159162 }
160163 body.putString(" reason" , reasonString)
@@ -164,7 +167,7 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler {
164167
165168 (event as ? Event .DiscardFunding )?.let { discardFunding ->
166169 val body = Arguments .createMap()
167- body.putHexString(" channel_id" , discardFunding.channel_id)
170+ body.putHexString(" channel_id" , discardFunding.channel_id. _a )
168171 body.putHexString(" tx" , discardFunding.transaction)
169172 return LdkEventEmitter .send(EventTypes .channel_manager_discard_funding, body)
170173 }
@@ -173,7 +176,7 @@ class LdkChannelManagerPersister: ChannelManagerConstructor.EventHandler {
173176 val body = Arguments .createMap()
174177 body.putHexString(" payment_hash" , paymentClaimed.payment_hash)
175178 body.putInt(" amount_sat" , paymentClaimed.amount_msat.toInt() / 1000 )
176- (paymentClaimed.purpose as ? PaymentPurpose .InvoicePayment )?.let {
179+ (paymentClaimed.purpose as ? PaymentPurpose .Bolt11InvoicePayment )?.let {
177180 body.putHexString(" payment_preimage" , (it.payment_preimage as Option_ThirtyTwoBytesZ .Some ).some)
178181 body.putHexString(" payment_secret" , it.payment_secret)
179182 }
0 commit comments