dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

After fast sync wallet is not in the same state as after pruning #896

Open kostyantyn opened 5 years ago

kostyantyn commented 5 years ago

Is your feature request related to a problem? Please describe

  1. [ ] After the fast sync, wallet transactions don't have inputs (as they are not part of UTXO) and wallet doesn't know about all spent transactions. Because of this, we can't see the full log of wallet transactions.
  2. [ ] CMerkleTx has a field nIndex which contains the position of the transaction in the block. We also don't have this field and it's set to 0.

Describe the solution you'd like A node can recover missing inputs by asking peers for its full transactions. To recover the position, we can either request the full block (too slow) or create a new p2p message that returns the needed leaves to reconstruct the merkle root and the position of our transaction.

scravy commented 5 years ago

Since this is tagged 1.0, I wonder if https://github.com/dtr-org/unit-e/pull/885 is that urgent.

I would prefer not to rush this for a perceived quick win. Especially the wallet (pruning, fast sync, SPV/light, merging with bitcoin 0.17, 0.18) will require some serious thinking.

kostyantyn commented 5 years ago

@scravy https://github.com/dtr-org/unit-e/pull/883 seems not related much to this. Do you mean https://github.com/dtr-org/unit-e/pull/885 ?

scravy commented 5 years ago

I do. Edited.