-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Null hash for transaction, mainly with Standalone blockchain #1267
Conversation
…rlpEncoded != null). See pull request #1057
@ESchouten could you, please, add a test which is failing in current develop, but will pass with your fix. I couldn't reproduce the same bug and have not find the place in code where it could happen. Looks like I'm missing something. |
@zilm13 I agree writing a unit test which demonstrates the race condition would be ideal. Problem is, I have not yet identified the source of this issue. |
I am however able to repoduce the state of where rlpEncoded is initialized and the hash byte array is empty, though when trying to debug the origin of this, the race condition does not occur, probably due to the IDE pausing threads etc. The parsed boolean is always true, due to the Transaction class constructor used, so rlpParse() is never executed. The only code I could find initializing the rlpEncoded array and not setting the hash value is located in InternalTransaction.java, though the class' method does not seem to be called. |
@ESchouten so, it's race condition, in this case setting |
@zilm13 Agree, seems to work aswell! Still, in that case, we're still assuming the E.g. The class InternalTransaction extends Transaction and overrides What do you think? |
@ESchouten why it's not maintainable?
|
@zilm13 Ah that explains. |
@zilm13 Reverted my change and made |
Fix for empty array returned when (hash == null && parsed == true && rlpEncoded != null). See pull request #1057