Giter Site home page Giter Site logo

Comments (11)

m2049r avatar m2049r commented on May 10, 2024

Saving is done only on sync and not when the user backs out of the wallet, because saving takes > 30 seconds. Maybe we can make an exception if the wallet is not synced yet. But then we are in the "wrapping things up" dialog for over 30 seconds and the user is like "wtf, this is broken!"

It's a tough call.

On the other hand: wait for the sync to finish and you are fine :) Maybe a warning dialog that all will be lost if the user exits before sync is done?

from xmrwallet.

SlinkyPotato avatar SlinkyPotato commented on May 10, 2024

What if there were milestone block heights that the app can keep track of so if the wallet was synced past this block, the user had the option to resume from that point even though they originally didn't specify a starting height at wallet creation?

Syncing is taking way to long and I would love it if it can sync in chunks.

Additionally there seems to be a bug where my wallet was synced but didn't save and now when I tap the wallet again, it begins syncing from the beginning. My phone might have lost internet connection sometime during syncing but there was text stating that it was synced.

from xmrwallet.

ehanoc avatar ehanoc commented on May 10, 2024

Hey, i'm using monerujo as a lib project to integrate monero in my Bitcoin wallet. I've implemented this. Wallet::store() is very quick on my end. I am using a dedicated thread for the Coin Management stuff though.

I'm still playing with it, but i have this changes on a branch. @m2049r Check https://github.com/ehanoc/xwallet/blob/1ced382b6855c19bbcbc9b58e10f862025479e38/app/src/main/java/com/bytetobyte/xwallet/service/coin/monero/MoneroManager.java#L502

I can implement something similar on your project if you're ok with it. We can discuss details.

from xmrwallet.

m2049r avatar m2049r commented on May 10, 2024

The current plan is to store the wallet if the user leaves the Wallet Activity. So no periodic store but only when synced or "aborted" to be continued later.

@ehanoc I looked at your code and cannot see any reason for storing to be faster. Monerujo does the saving in its own service thread. Storing a fully synced mainnet wallet takes about 15 seconds on my galaxy s4, a testnet wallet about 6 seconds.

Tying storing to number of blocks loaded is not so good because different nodes sync at different speed - a local node syncs at maybe 2000 blocks a minute and a public remote node maybe only 500. so picking the "correct" number of blocks to sync after is difficult -> therefore the solution proposed above.

from xmrwallet.

ehanoc avatar ehanoc commented on May 10, 2024

@m2049r, my service runs in it's own dedicated process and has its own memory space, yours runs in the same process & same memory space as the main app process. I need IPC due to that. I don't think it makes that much difference but I store a wallet in 1 / 2 seconds.

But, syncing is only catch-up and if you check the store() functions code, they don't check with the nodes, it just saves whatever state we have.

I do think this it's important because restoring can take a long time once you reach the restoring height starting block. Android often kills on going processes as it needs resources for other things and we shouldn't be making users just wait for this to finish.

from xmrwallet.

m2049r avatar m2049r commented on May 10, 2024

it's got nothing to do with didicated process or heap. it's got to do with the hardware you run it on. a fresh wallet on an s7 edge also takes 1-2 seconds to store in monerujo. also, as the monerujo wallet process runs as a foreground service it is not as susceptible to getting killed by the system as a dedicated background service.

nonetheless, as already mentioned, i will implement storing when not synced when the user backs out - but has to wait for storing to finish.

from xmrwallet.

jonathancross avatar jonathancross commented on May 10, 2024

Can this be closed in light of #152 ?

from xmrwallet.

skorokithakis avatar skorokithakis commented on May 10, 2024

For some reason, my phone's screen locked while syncing and monerujo locked the wallet without syncing the state. Is this a bug?

from xmrwallet.

m2049r avatar m2049r commented on May 10, 2024

probably not. maybe it did not load any blocks so there was nothing to save. usually there is no problem even if you lock the phone while syncing.
can you reproduce this? maybe with another node as well?

from xmrwallet.

skorokithakis avatar skorokithakis commented on May 10, 2024

It definitely saved blocks, it had made a lot of progress. Not only that, but syncing the state of my Ledger wallet always kicked me out to the wallet list after a point, so it's impossible to complete.

I will try another node.

from xmrwallet.

skorokithakis avatar skorokithakis commented on May 10, 2024

I'm still having problem with this. It tells me "Synced" but then after a while it'll say "syncing 600,000 blocks" and AFAICT continue syncing. If my screen locks, opening the wallet again will take me to the home screen and ask me to open the wallet again. This is with a Ledger wallet.

I did try various nodes.

from xmrwallet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.