9

So from time to time I use my monero-wallet-cli together with the monerod. I start up monerod and wait until its up to date. Then I start up the monero-wallet-cli but its empty.

Now I have to use the refresh command and wait about 10-20min for all blocks to be re-scanned.

I can't imagine that I have to wait that long before i have a balance and can move it from old confirmed blocks that I synced days before.

So how does the monero-wallet-cli auto refresh work? Is there someway to only refresh new blocks or is monero-wallet-cli already doing that, if yes can I somehow see the progress?

I would love to just have the daemon run in the background or on a pc in my network and only open monero-wallet-cli when I need to make a transaction but having to wait for it to refresh all blocks takes just to long.

Do I miss something that could help me with the problem?

(related question: Why do I need to refresh my wallet?, Can simplewallet auto refresh?)

10

If you use exit in simplewallet the last refreshed block will be saved in the wallet cache, i.e., the wallet's memory. Thus, the next time you will refresh the wallet, it will start refreshing from the last block it has saved. In addition, in simplewallet you can find, and reiterating what mwdddgcs said:

Always use "exit" command when closing simplewallet to save current session's state. Otherwise, you will possibly need to synchronize your wallet again. Your wallet key is NOT under risk anyway.

Autorefresh simply refreshes the wallet automatically (if it is opened) when the daemon retrieves a new block (or every few blocks). Autorefresh is set to 1 for new wallets, i.e., wallets that were created after 0.9.4 was released. For wallets that were created before 0.9.4 was released, you have to set autorefresh to 1 manually with the following command:

set auto-refresh 1


if yes can i somehow see the progress?

Simplewallet depicts the process in numbers. That is, it will state 1100000/1116137 if it has 16137 more blocks to go.

  • If the wallet starts to sync from 0 height, is there a way to get it to start further without recreating the wallet again? – farinspace Apr 30 '18 at 23:12
  • It will always "start" from 0, see here: monero.stackexchange.com/questions/7581/…. If you want to change the restore height whilst it's refreshing, first ^C (CTLR + C) to cancel the refresh. Subsequently, open the wallet in "offline" mode (i.e. not connected to a daemon). Lastly, use set refresh-from-block-height <new-restore-height> to change the restore height. Hopefully this explanation is sufficiently clear. – dEBRUYNE May 9 '18 at 14:36
5

In simplewallet it says:

Always use "exit" command when closing simplewallet to save current session's state. Otherwise, you will possibly need to synchronize your wallet again. Your wallet key is NOT under risk anyway.

When I run refresh it only needs to scan the newest blocks, because the old transactions are saved in the wallet. Maybe you're not closing the wallet properly?

5

As mentioned by others, you need to exit the wallet normally. The wallet cache isn't a database (yet), so needs saving, you can't kill it like you can kill the daemon and not lose data. So exit by either the exit command, or ^D.

If you do exit normally, a subsequent start of the wallet till refresh just the blocks received by the daemon since last time you exited the wallet.

In recent enough wallets, there is a background refresh thread, so you don't have to run refresh manually (it is optional, and can be changed via the set command). The auto refresh will poll the daemon every 90 seconds for new blocks.

With recent enough wallets, ^C while in a foreground refresh will cancel the refresh, so you can exit partway through a refresh. ^C in other places exits the wallet without saving.

To see if the wallet is synced, try status. This only works with recent wallets.

2

Wallet refresh towards the end takes a hell lot of time(running on a remote daemon doesn't change anything). On Windows I don't see a clean way to exit so all the time it starts from the beginning.

As mentioned by others, you need to exit the wallet normally. The wallet cache isn't a database (yet), so needs saving, you can't kill it like you can kill the daemon and not lose data. So exit by either the exit command, or ^D.

If you do exit normally, a subsequent start of the wallet till refresh just the blocks received by the daemon since last time you exited the wallet.

In recent enough wallets, there is a background refresh thread, so you don't have to run refresh manually (it is optional, and can be changed via the set command). The auto refresh will poll the daemon every 90 seconds for new blocks.

With recent enough wallets, ^C while in a foreground refresh will cancel the refresh, so you can exit partway through a refresh. ^C in other places exits the wallet without saving.

To see if the wallet is synced, try status. This only works with recent wallets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.