Bitcoin Forum
April 23, 2024, 01:35:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Get unused address in commandline  (Read 317 times)
gdiepen (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
January 17, 2017, 05:23:28 PM
 #1

I was wondering if it is possible to use the get_unused_address functionality of a wallet from the commandline.

I was looking at the example to receive bitcoins on the website and based on this I wanted to see if I could create a donate link that would always show the latest unused address (i.e. after any donation, the next request on the webserver will automatically show the next unused bitcoin address).

I understand from the source that the addrequest command does this internally, but it will actually use up all the addresses within the gap every time you are calling addrequest.

Is it possible to call the get_unused_address from the commandline of electrum?
1713879339
Hero Member
*
Offline Offline

Posts: 1713879339

View Profile Personal Message (Offline)

Ignore
1713879339
Reply with quote  #2

1713879339
Report to moderator
1713879339
Hero Member
*
Offline Offline

Posts: 1713879339

View Profile Personal Message (Offline)

Ignore
1713879339
Reply with quote  #2

1713879339
Report to moderator
1713879339
Hero Member
*
Offline Offline

Posts: 1713879339

View Profile Personal Message (Offline)

Ignore
1713879339
Reply with quote  #2

1713879339
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
kolloh
Legendary
*
Offline Offline

Activity: 1736
Merit: 1023


View Profile
January 17, 2017, 08:25:48 PM
 #2

I was wondering if it is possible to use the get_unused_address functionality of a wallet from the commandline.

I was looking at the example to receive bitcoins on the website and based on this I wanted to see if I could create a donate link that would always show the latest unused address (i.e. after any donation, the next request on the webserver will automatically show the next unused bitcoin address).

I understand from the source that the addrequest command does this internally, but it will actually use up all the addresses within the gap every time you are calling addrequest.

Is it possible to call the get_unused_address from the commandline of electrum?

It doesn't seem like you can call get_unused_address via commandline from what I can tell. I checked and it doesn't look like you can issue that via JSONRPC either. However, you could issue it via the python console.

Electrum recommends using addrequest to accept payments via a website so I wouldn't think there would be any negative side effects for doing it in that manner.
gdiepen (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
January 18, 2017, 07:00:56 AM
 #3

I was wondering if it is possible to use the get_unused_address functionality of a wallet from the commandline.

I was looking at the example to receive bitcoins on the website and based on this I wanted to see if I could create a donate link that would always show the latest unused address (i.e. after any donation, the next request on the webserver will automatically show the next unused bitcoin address).

I understand from the source that the addrequest command does this internally, but it will actually use up all the addresses within the gap every time you are calling addrequest.

Is it possible to call the get_unused_address from the commandline of electrum?

It doesn't seem like you can call get_unused_address via commandline from what I can tell. I checked and it doesn't look like you can issue that via JSONRPC either. However, you could issue it via the python console.

Electrum recommends using addrequest to accept payments via a website so I wouldn't think there would be any negative side effects for doing it in that manner.

I did see that in the commandline version there should be something like listaddresses with the option of --unused. I tried this, but unfortunately did not see anything change, even the addresses that received already were shown.

The reason why I am hesitant with addrequest is that you quickly exceed the number of addresses, which is something I wanted to prevent. In the case of a Donate link I would like to keep on using one donation address as long as nothing has been transferred to this address. Whenever the address is used, I would like to switch to the next unused address.
Abdussamad
Legendary
*
Offline Offline

Activity: 3598
Merit: 1560



View Profile
January 18, 2017, 08:13:25 AM
 #4

edit: I missed some posts  Smiley

Why not use addrequest in combination with getaddressbalance? if an address has a balance then it's used and you get a new one with addrequest.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!