Bitcoin Forum
December 16, 2017, 09:33:04 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Get unused address in commandline  (Read 252 times)
gdiepen
Newbie
*
Offline Offline

Activity: 2


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?
1513459984
Hero Member
*
Offline Offline

Posts: 1513459984

View Profile Personal Message (Offline)

Ignore
1513459984
Reply with quote  #2

1513459984
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513459984
Hero Member
*
Offline Offline

Posts: 1513459984

View Profile Personal Message (Offline)

Ignore
1513459984
Reply with quote  #2

1513459984
Report to moderator
kolloh
Legendary
*
Offline Offline

Activity: 1176


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
Newbie
*
Offline Offline

Activity: 2


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: 1582



View Profile WWW
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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!