Closed LivioZ closed 3 years ago
Could you provide a minimal reproducible example?
This
self.__wallet.send([], fee = 1, message = binascii.unhexlify(msg))
where the message is an hexadecimal string. That's all I did.
You need to call wallet.get_unspents()
before. Or wallet.get_balance()
. Does that solve the issue?
100% would solve the issue (and it does), but is it intended to work this way? And I don't know why it worked days ago.
Yes it is intended as per the docs https://pybitcash.github.io/bitcash/.
Maybe in a future major version, send could take care of collecting unspents. I am happy to receive pull requests and potentially include such a change later on.
Hello, the issue is, a few days ago a successfully sent a transaction with the .send function. Today I tried again and got an error about unspents, so i did a little bit of debbuging and I found out that unspents do not get updated before the call to
self.unspents
in the create_transaction function before the sanitizing, so I addedor NetworkAPI.get_unspent(self.address)
here instead ofor self.unspents
:and now it works as it should, but obviously I have some doubts about this, can you help me figure out the issue? The error I got is the following: