Skip to content

Commit

Permalink
fix: if a error is throws from bitcoind return the error to cln
Browse files Browse the repository at this point in the history
This is always true except for the get block by height

Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Nov 16, 2022
1 parent 528d1b4 commit 7ab269a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion btcli4j-gen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# Script generated from gradle! By clightning4j

/usr/lib/jvm/jdk-11.0.10/bin/java -jar /home/vincent/Github/clightning4j/btcli4j/build/libs/btcli4j-all.jar
/home/vincent/.jdks/azul-15.0.9/bin/java -jar /home/vincent/Github/clightning4j/btcli4j/build/libs/btcli4j-all.jar
1 change: 1 addition & 0 deletions compile_commands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class GetChainInfoBtc(
throw exception
} catch (exception: Exception) {
when (exception) {
/*is BitcoinCoreException -> {
is BitcoinCoreException -> {
plugin.log(PluginLog.ERROR, "GetChainInfoBtc: terminate bitcoin core with error: %s".format(exception.message))
}*/
}
is LiteBitcoinRPCException -> {
plugin.log(PluginLog.ERROR, exception.stackTraceToString())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ class SendRawTransactionBtc(private val bitcoinRPC: LiteBitcoinRPC, private val
when (exception) {
is BitcoinCoreException -> {
plugin.log(PluginLog.ERROR, "GetChainInfoBtc: terminate bitcoin core with error: %s".format(exception.message))
response.apply {
add("errmsg", exception.message)
}
}
is LiteBitcoinRPCException -> {
plugin.log(PluginLog.ERROR, exception.stackTraceToString())
plugin.log(PluginLog.DEBUG, "SendRawTransactionBtc: Share message to esplora")
alternative.run(plugin, request, response)
}
}
plugin.log(PluginLog.DEBUG, "SendRawTransactionBtc: Share message to esplora")
alternative.run(plugin, request, response)
}
}
}

0 comments on commit 7ab269a

Please sign in to comment.