Skip to content

Commit

Permalink
Message: Fix exception due to unknown message having an unknown lengt…
Browse files Browse the repository at this point in the history
…h. That's ok.
  • Loading branch information
Andreas Schildbach authored and ripcurlx committed Aug 17, 2021
1 parent 5592700 commit 3d5804f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/core/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected Message(NetworkParameters params, byte[] payload, int offset, int prot

parse();

if (this.length == UNKNOWN_LENGTH)
if (this.length == UNKNOWN_LENGTH && !(this instanceof UnknownMessage))
checkState(false, "Length field has not been set in constructor for %s after parse.",
getClass().getSimpleName());

Expand Down

0 comments on commit 3d5804f

Please sign in to comment.