gottstech / gotts

A blockchain for non-collateralized stable-coins, follow MimbleWimble protocol but with explicit amount.
https://gotts.tech
Apache License 2.0
48 stars 4 forks source link

fix: spent output should remove the output position height index #25

Closed garyyu closed 4 years ago

garyyu commented 4 years ago

Fix https://github.com/gottstech/gotts/issues/24

garyyu commented 4 years ago

This doesn't work in case of a fork, since the spent output/s has removed the database index but the txhashset::apply_input rely on self.batch.get_output_pos_height(&commit) to find the index.

Need more think about the solution...

garyyu commented 4 years ago

As a workaround, I just remove the unwrap and use ? instead.

Let's leave a todo item here to clean the index garbage, test spend_in_fork_and_compact will fail if do that, unclear root cause at this moment.