C-Otto / BitBook

BitBook helps you organize your bitcoin addresses and transactions.
https://bitbook.c-otto.de
MIT License
43 stars 6 forks source link

Bug: lnd-add-from-channels crashes when channel with very recent transaction is included in JSON #116

Closed C-Otto closed 3 years ago

C-Otto commented 3 years ago

Describe the bug When using lnd-add-from-channels BitBook crashes:

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0

BitBook tries to read details from the opening transaction. If this transaction is too recent, the internal representation does not have any output. This conflicts with the assumption that a channel output transaction has at least one output, namely the channel.

A similar problem might exist for other import functions.

To Reproduce Create a new channel and use lnd-add-from-channels while the transaction has just a few confirmations.

Expected behavior The channel is imported or ignored.