Error!
Failed to send transaction: Encountered invalid prevhash.
why?
I'm trying to send a Litecoin transaction using python-trezor and I'm getting the exact same error. Looking at the trezor-mcu code I find that it is sent here:
https://github.com/trezor/trezor-mcu/blob/master/firmware/signing.c#L349 but I didn't debug it to understand what is going on. Could be a byte order thing or I just didn't put the right prev_hash to start with, not sure.
For reference I'm sending the only output of this tx:
https://bchain.info/LTC/tx/3635c6b4ddb52a669a5db11e1a599d9149f18e803c178653c05d9e804afa4f57So I do a TxInputType(address_n=client.expand_path(path to LS7CBRe81UbZJLjMG5p7gLB3DbgV2rNZ5q), prev_hash=binascii.unhexlify('3635c6b4ddb52a669a5db11e1a599d9149f18e803c178653c05d9e804afa4f57'), prev_index=0) which I guess is what I'm supposed to provide, but in my obvious diagonal reading of both python-trezor and trezor-mcu, it looks like the comparison is being make with the txhash of the first input of that transaction (though I may be completely off-base here, I'll have to compile trezor-mcu myself to add some debugging if no help comes my way)
Any clues or pointers?
EDIT: I finally found the problem I was having and it goes down to a bug in python-trezor's tx_api.insight_url. Well, maybe it doesn't reflect on every OS the same way but doing Decimal(value_as_float) is very dangerous and error prone in python, so I'll be getting a pull request ready.