Closed brad1121 closed 5 years ago
How does hasTransactions return null
?
It would be helpful to see the call stack of such a case.
Android Studio does point out that List.isEmpty() can produce a NullPointerException.
the original method says: !this.transactions.isEmpty();
and it is possible that this transactions = null
in the case that the block contains only the header. Not sure if this is related to my question.
Yea that would be it, block with only headers returns null. I think its cleaner it return false.
Migrated to Bitcoin SV library.
non-critical but avoids an extra unnecessary null check/exception which annoyed me at one point.