moontreeapp / moontree

Primary Mono Repo
6 stars 5 forks source link

Optimize and simplify init download #517

Closed lastmeta closed 2 years ago

lastmeta commented 2 years ago

Describe The Task

By producing two contexts. You need a flat to set it you find a wallet without any addresses. If the flag is set, when you make a new address do nothing in the address waiter.

Instead go through a linear process of: Derive, get histories by address in batch, derive until done. Get unspents in batch. Build balances. Get transactions in batch by address, or by arbitrary batch number. Get dangling transactions Get status of addresses, save Subscribe to each address Unset flag

In the general process: subscribe to each address: If status update... Get unspents. Recalculate balances for affected symbols Get histories Get transactions in batch. Get dangling transactions Save status update Derive more addresses

This way we can simplify all the complexity in history download service.

Additional Context

No response

lastmeta commented 2 years ago

should Balances now be temporary? we build it up every time. why write to disk?

lastmeta commented 2 years ago

still experiencing a glitch when all tx are downloaded that the RVN balance gets messed up. other than that seems to work relatively well, cleaned up a bunch of unnecessary code on doubleContextDownload branch.