Bitcoin Forum

Bitcoin => Electrum => Topic started by: crazylol on March 31, 2017, 11:33:11 AM



Title: Electrum not restoring addresses from seed
Post by: crazylol on March 31, 2017, 11:33:11 AM
Hi All!

We have a strange problem with electrum-wallet.

Facts: We have 10 electrum-daemons 2.7.18, which run under different users on one server. JSON-requests to this daemons are balanced by nginx. All works fine about the month (without restart), but recently we wanted to update our wallets to 2.8.2. After command electrum daemon stop balance of 5 wallets out of 10 became 0. Then, i started electrum daemons again, and in 5 of 10 wallets balance became much less than should be.
Ok, I tried to restore this wallets from seed, but, unfortunately, balance was like after reboot.

Investigation: Fortunally, all addresses, which were used for payment requests were stored in 2 places - in wallet_file and on the filesystem. Grep on payment requests showed more than 700 addresses, which were used for this requests, but electrum listaddresses showed me less than 300 addresses.

Next, I took one random address from 700 and said electrum ismine _thisaddress_, result was false. I manually added this address in wallet_file in tag "addresses":"receiving", and after that result of electrum ismine _thisaddress_ became true.

Ok, next I tried to send BTC from this address and received an error: 'code': -26, 'message': '16: mandatory-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation) - this error means "error in sign of transaction". Sending BTC from addresses, restored from seed, was fine.

Next, I tried to export private key of _thisaddress_. It was ok, but, when I tried to import it to new wallet, I saw, that address of this private key did not match with _thisaddress_. I think, that this situation and error: 'code': -26 have one reason.

Next, I exported all 700+ addresses from payment requests, flushed tag "addresses":"receiving" in wallet_file and manually added all this addresses in this tag. After that, I exported all private keys from this wallet and imported them to new wallet. The balance of new wallet became correct and I could send BTC from this addresses.

Question: Why did this happen? :)


Title: Re: Electrum not restoring addresses from seed
Post by: jonald_fyookball on April 09, 2017, 05:19:29 AM
was it the gap limit?


Title: Re: Electrum not restoring addresses from seed
Post by: crazylol on April 13, 2017, 08:42:18 AM
Yes, wallet.gap_limit return 20. But it was 20 in good_wallets too.