Improve stream handling (#244)

* Improve stream management

* Check swap for existing lockup/refund tx

* Set broadcast capacity to 30
This commit is contained in:
Ross Savage
2024-05-30 14:54:15 +02:00
committed by GitHub
parent 4cd2673d01
commit 35561bacc5
17 changed files with 320 additions and 454 deletions

View File

@@ -428,21 +428,21 @@ fun asSendPaymentResponse(sendPaymentResponse: ReadableMap): SendPaymentResponse
if (!validateMandatoryFields(
sendPaymentResponse,
arrayOf(
"txid",
"payment",
),
)
) {
return null
}
val txid = sendPaymentResponse.getString("txid")!!
val payment = sendPaymentResponse.getMap("payment")?.let { asPayment(it) }!!
return SendPaymentResponse(
txid,
payment,
)
}
fun readableMapOf(sendPaymentResponse: SendPaymentResponse): ReadableMap {
return readableMapOf(
"txid" to sendPaymentResponse.txid,
"payment" to readableMapOf(sendPaymentResponse.payment),
)
}