Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to spent whole UTXO #105

Closed
MartinHronsky opened this issue Dec 8, 2019 · 3 comments
Closed

Unable to spent whole UTXO #105

MartinHronsky opened this issue Dec 8, 2019 · 3 comments

Comments

@MartinHronsky
Copy link

@MartinHronsky MartinHronsky commented Dec 8, 2019

Hello everyone,

I'm experiencing an issue when trying to send my whole account balance to myslef (on a private node, for academic purposes). The problem is that as i start the private NEO node, my account balance is 100000000 NEO, as 1 UTXO. What happens when i try to create an AssetTransfer from this account to itself, sending myself all NEO at once, it crashed because of a NullPointerException.

I think the problem is in the method getChangeTransactionOutput in class AssetTranfer. When the inputAmount and requiredValue are equal, the method returns null, which gets inserted into the array of the outputs for this AssetTransfer. This eventually crashes at io.neow3j.io.BinaryWriter.writeSerializableFixed(BinaryWriter.java:139) - it tries to call serialize on a null value.

The same issue happens when i try to send 1 NEO to myself more than once. First time it works, then my guess is the input calculation strategy chose the 1 NEO UTXO as input, and it crashed on a nullpointer as well.

I'm just beginning with blockchain technology at all, so i might have missed something, but since such a transfer works fine using the RCP API directly, i figured out this might be an issue in this library.

Thanks and best regards,
Martin Hronsky

@MartinHronsky

This comment has been minimized.

Copy link
Author

@MartinHronsky MartinHronsky commented Dec 8, 2019

After reading through the issues once more i found out that this has already been resolved in #98. Sorry for the duplicate, the title of the original was not really intuitive, thats why i havent noticed it.

@gsmachado

This comment has been minimized.

Copy link
Member

@gsmachado gsmachado commented Dec 9, 2019

Hello @MartinHronsky,
Thanks for the detailed report! Much appreciated.
So, yes, it was resolved by #98 -- however, it was not released yet. We're planning a release this week. Once we release I will let you know in this thread and I will close this issue.
Any other questions, let us know. :-)

@gsmachado

This comment has been minimized.

Copy link
Member

@gsmachado gsmachado commented Dec 13, 2019

Hello @MartinHronsky
We released version 2.3.1, finally! We had a problem with Nexus/SonaType. It should be available on Maven Central already.
If it's not, please, comment here on the issue again.

@gsmachado gsmachado closed this Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.