Closed mateuszviste closed 8 years ago
btw, I am running latest version (2.7.0) from git's electrum-master.
I wondered whether perhaps creating a new address is not as simple as creating a new "receiving request", so I went that way, and tried to create a new "receive" entry. This message then appeared:
Warning: The next address will not be recovered automatically if you restore your wallet from seed; you may need to add it manually. (...) Create anyway?
Whether I answer "yes" or "no", the result is exactly the same: nothing happens. No new address appears in my addresses list.
I shall add that I created my wallet manually, importing a list of 3 private keys I had created in bitcoin-qt. I was able then to create 3 "receive requests" and Electrum used each address I had imported alright, but apparently it is unable to create new addresses on its own...
if you created your wallet manually, how do you expect it to create new addresses?
if you want to create new addresses, you need to create a deterministic wallet (with a seed)
create_new_address should not be mentioned in the doc. you should use 'addrequest' instead the warning dialog you saw is clearly an error. it should be displayed only if the wallet is deterministic.
okay, I see - so the "deterministic" behavior of electrum is an enforced way of doing things, not an optional feature... I was hoping that with a custom wallet, electrum would still be able to create new (non-deterministic, ie. random) addresses, like bitcoin-qt does for instance. Is there a future where such thing would be possible, or am I talking crazy?
no, this is not planned; why would anyone want to do that?
no, this is not planned; why would anyone want to do that?
I'm sorry if I misunderstand something, I might have missed something obvious... My situation is an example of a "migrating user". That is, a user that was using some other_wallet_software (in my case bitcoin-qt), but got tired of it and decided to switch to electrum. Of couse, the user wants to have his real balances displayed in electrum, which means he must import his old addresses & private keys (which I did), creating a "non-deterministic wallet" as a result. But then, for receiving new funds, the user needs to create new addresses - and that's where the problem appears. Currently I am able to use electrum to watch my imported wallet, but I am unable to create new requests (since electrum is unable to generate new addresses for a non-deterministic wallet).
create a deterministic wallet, and use it as your main wallet.
create a deterministic wallet, and use it as your main wallet.
That's what I will end up doing, yes... But that's far from perfect - I am still likely to receive funds on my old addresses, so I have to keep them around, meaning the balance displayed by electrum will not be right unless I re-transfer funds from my old addresses to new (deterministic) ones each time, which is kind of an annoyance.
that's what you get for not using Electrum in the first place.
I tested last commit a45095e and now when I try creating a new address in my non-deterministic wallet I obtain a message "No more addresses in your wallet". Now (after your explanations) I understand this message, but otherwise I'd be probably confused and search for some way to create new addresses. It would probably be more user-friendly to add to this message a short note saying "you using non-deterministic wallet so new addresses no can do, use a deterministic wallet instead".
ok, will do
I'm interested that method was available in JSON-RPC interface (and command line).
For example, I'm need same count of unused wallets in electrum (In theory more than 20), because a high-level business logic worked with Electrum by API.
But addrequest
should also do the trick (need to check).
@osminogin You can also manually change the gap limit so that Electrum will keep x unused addresses instead of 20, where x can be any integer.
Open the wallet you want to change and type into the console:
wallet.storage.put('gap_limit',25)
and replace 25 with the number you want of empty addresses.
After doing this command, wait 5 seconds or so. Then close Electrum, then re-open Electrum and you should see the amount of addresses you asked for on the addresses tab.
in file 'wallet.py' edit self.gap_limit = storage.get('gap_limit', 20)
save and restart
Hello, this issue is both a feature request and bug report :)
Feature request: I'd like to pre-generate a few bitcoin addresses. In bitcoin-qt it's very easy, unfortunately Electrum doesn't provide a suitable button for that. It would be awesome to have a simple "new" button in the "Addresses" tab...
Bug report: I have read the article below: http://docs.electrum.org/en/latest/faq.html#how-can-i-pre-generate-new-addresses
And I tried to generate a new address using the query that is given in the above documentation. I suppose the syntax must have change at some point, because I get an error about missing argument:
>> wallet.create_new_address()
Traceback (most recent call last):
TypeError: create_new_address() takes exactly 2 arguments (1 given)
I looked then at what help() would say about the create_new_address() function, but apparently this function is not listed in the help() output. Any chance you could document the proper syntax for create_new_address() ?