Bitcoin Forum
April 25, 2024, 04:45:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: "listaccounts" and "labels" : why is it this way ?  (Read 608 times)
heretolearn (OP)
Full Member
***
Offline Offline

Activity: 128
Merit: 100



View Profile
February 25, 2014, 01:06:29 PM
 #1

I tried to make a new address and have the same label for two addresses. When I typed "listaccounts" it showed me only the label which was the same for both addresses.

When I change the label to something else then all the addresses according to labels are listed.

Why does listaccounts show according to labels ? I mean to ask what is the logic behind it. Wouldnt showing by addresses be more meaningful ?
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
syslog
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile WWW
February 25, 2014, 02:15:51 PM
Last edit: February 26, 2014, 08:13:00 AM by syslog
 #2

accounts & labels are the same,  

basically when you call listaccounts call it will show you accounts as key and balance as value ( it's quite usefull when you have multiple addresses pointed an account(label)


i think getaccountaddress getaddressesbyaccount call is what you are looking for .

PS: btc supports rpc2.0  this makes your life easier.



davidpbrown
Sr. Member
****
Offline Offline

Activity: 531
Merit: 260


Vires in Numeris


View Profile WWW
February 25, 2014, 02:22:20 PM
 #3

I tried to make a new address and have the same label for two addresses. When I typed "listaccounts" it showed me only the label which was the same for both addresses.

When I change the label to something else then all the addresses according to labels are listed.

Why does listaccounts show according to labels ? I mean to ask what is the logic behind it. Wouldnt showing by addresses be more meaningful ?


Accounts surely are a sum of addresses. So, what you've described makes sense.

If you want a list by addresseses then try
 listreceivedbyaddress 0 true
which, if I've remembered that correctly, will list all addresses even with zero balance and their label.

List by account then, from what you've described, groups by label =='account'.

฿://12vxXHdmurFP3tpPk7bt6YrM3XPiftA82s
heretolearn (OP)
Full Member
***
Offline Offline

Activity: 128
Merit: 100



View Profile
February 25, 2014, 08:40:36 PM
 #4

accounts & labels are the same, 

basically when you call listaccounts call it will show you accounts as key and balance as value ( it's quite usefull when you have multiple addresses pointed an account(label)


i think getaccountaddress call is what you are looking for .

PS: btc supports rpc2.0  this makes your life easier.

I tried getaccountaddress and found stange results, it sometimes generates a new address with the same label as the argument !! How does that work ?

Also any link as to how and what advantages rpc2.0 has when used with btc ?
heretolearn (OP)
Full Member
***
Offline Offline

Activity: 128
Merit: 100



View Profile
February 25, 2014, 08:44:50 PM
 #5

Accounts surely are a sum of addresses. So, what you've described makes sense.

If you want a list by addresseses then try
 listreceivedbyaddress 0 true
which, if I've remembered that correctly, will list all addresses even with zero balance and their label.

List by account then, from what you've described, groups by label =='account'.

Hmm that helped clear some doubts. Thanks.
syslog
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile WWW
February 26, 2014, 08:18:34 AM
 #6

accounts & labels are the same,  

basically when you call listaccounts call it will show you accounts as key and balance as value ( it's quite usefull when you have multiple addresses pointed an account(label)


i think getaccountaddress call is what you are looking for .

PS: btc supports rpc2.0  this makes your life easier.

I tried getaccountaddress and found stange results, it sometimes generates a new address with the same label as the argument !! How does that work ?

Also any link as to how and what advantages rpc2.0 has when used with btc ?
Oh, i made a mistake.  your call should be getaddressesbyaccount not getaccountaddress (this actually returns only address)

about rpc2.0 http://www.jsonrpc.org/specification#examples

I'm sorry for the mistake.

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!