Open robvanmieghem opened 6 years ago
That error can only be returned in case it tries to spend a coin output that could no longer be found in the consensus set. Meaning that it never existed, or more likely that it was already spend. So the bug is probably in the wallet module, which somehow tries (or tried) to spend a coin output that was already spend.
It doesn't help that we do not log the coin output ID and that kind of information in case of such an error though. For now going to read through that logic, to see if I can spot something weird just by reading.
The TxBuilder (which is what you use when sending that command) has 3 properties it uses of the wallet, that are relevant to how it auto-funds the coins you are about to send:
Fairly sure (2) is the reason why you are getting this error. But need to understand that part a bit more, as that code was originally from Sia, and it's been a while since I saw it.
Didn't state it explicitly, but (1) coinOutputs
is fine as is. A coin output (diff) is reverted not only when the block that added the coin output is reverted, but also when it is used as a coin input. And thus, that mapping of the Wallet
will be up to date with the available.
Stating this explicitly, I wonder even more what the purpose of (2) spentOutputs
is for confirmed outputs.
Fairly sure (2) is the reason why you are getting this error. But need to understand that part a bit more, as that code was originally from Sia, and it's been a while since I saw it.
Nevermind, looking further into this, I do not think it can be your issue. It only is used to ensure we do not spend an output too quickly again. However as the outputs can only come from the unspent coin outputs and unconfirmed txs, and the wallet of @robvanmieghem had no unconfirmed txs, it cannot have caused an issue in any way.
I am stuck, however quoting myself from earlier:
That error can only be returned in case it tries to spend a coin output that could no longer be found in the consensus set. Meaning that it never existed, or more likely that it was already spend.
There are 2 possibilities as I see it:
Going to add a log statement, so that we can know what coin output is being spend while this happens. This way we at least have more of an idea to know where to start looking, in case it happens.
Rivine has the extra logging info, and tfchain
has latest master of rivine as well. When you encounter this error again @robvanmieghem:
consensus.log
file;tfchainc
;tfchainc wallet
;tfchainc wallet transactions
;I'll assume you try with a tfchain
CLI client on testnet
, but if not, please do tell me as well.
git describe v1.1.0