chris-belcher / electrum-personal-server

Maximally lightweight electrum server for a single user
MIT License
602 stars 110 forks source link

A question #150

Closed rou-nin closed 4 years ago

rou-nin commented 5 years ago

Hello i am wondering if addresses are imported to the wallet permanently or to the memory for temporary? I have too many addresses to check on my electrum client and it takes a long time to import after every restart. Is there a config to make this faster?

rou-nin commented 5 years ago

I have learnt that it imports them into wallet dat file but after first import it takes too much time to start the service. i think it might be because it is checking if all addresses are there. can i make it like it checks first 10 and last 10? so it wont check 50k addresses everytime i start the service.

chris-belcher commented 5 years ago

EPS takes a long time because it generates all the addresses on startup. Issue #112 is relevant here. EPS needs all the addresses because it has to be ready in case Electrum requests them, so it's not possible to just generate the first and last 10. And finally, EPS already only checks the that the first and last few addresses have been imported.

rou-nin commented 5 years ago

What i mean is that it takes time after initial startup too. I checked wallet.dat before importing and it was like KBs and after initial startup it was around 30mb. Initial startup took around 2 hours. then i tried several times but it still takes 2 hours even though addresses are imported to wallet.dat. It's fine though i am running it on a Raspberry Pi and it is running all the time. So ne need to wait for 2 hours. Just wondered why it takes the same time after first startup.

chris-belcher commented 5 years ago

It takes that time because EPS uses the master public keys to generate addresses, which is a slow operation.