Bitcoin Forum
May 13, 2024, 11:38:50 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoind getbalance with minconf = 0  (Read 3932 times)
TAiS46 (OP)
Full Member
***
Offline Offline

Activity: 222
Merit: 100



View Profile WWW
June 19, 2012, 07:48:44 AM
 #1

Hello,

is there a way, to list the total balance (bitcoind getbalance) with minconf = 0 instead of 1?

Have try something like:
bitcoind getbalance * 0

But then it will show me the balance of the account *!

Is there a way?

Greetings
Simon
Remember that Bitcoin is still beta software. Don't put all of your money into BTC!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715600330
Hero Member
*
Offline Offline

Posts: 1715600330

View Profile Personal Message (Offline)

Ignore
1715600330
Reply with quote  #2

1715600330
Report to moderator
1715600330
Hero Member
*
Offline Offline

Posts: 1715600330

View Profile Personal Message (Offline)

Ignore
1715600330
Reply with quote  #2

1715600330
Report to moderator
1715600330
Hero Member
*
Offline Offline

Posts: 1715600330

View Profile Personal Message (Offline)

Ignore
1715600330
Reply with quote  #2

1715600330
Report to moderator
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
June 19, 2012, 07:00:10 PM
 #2

Hello,

is there a way, to list the total balance (bitcoind getbalance) with minconf = 0 instead of 1?

Have try something like:
bitcoind getbalance * 0

But then it will show me the balance of the account *!

Is there a way?

Greetings
Simon
I believe Luke-jr's next-test branch shows an "unconfirmed balance" with getinfo.

github.com/luke-jr/bitcoin

Hopefully that will be pulled into the official repo soon.  I can't see how it would introduce any bugs.

mb300sd
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000

Drunk Posts


View Profile WWW
June 21, 2012, 05:45:56 AM
 #3

Hello,

is there a way, to list the total balance (bitcoind getbalance) with minconf = 0 instead of 1?

Have try something like:
bitcoind getbalance * 0

But then it will show me the balance of the account *!

Is there a way?

Greetings
Simon

If you are not using the accounts feature, all your bitcoins are in the account ""

try

bitcoind getbalance "" 0

1D7FJWRzeKa4SLmTznd3JpeNU13L1ErEco
geebus
Sr. Member
****
Offline Offline

Activity: 258
Merit: 250



View Profile WWW
June 21, 2012, 08:07:27 AM
 #4

Also, if not using the command line (i.e. using Python or PHP) you can use "*" as the account name and it actually will wildcard all accounts.

Python: (requires python-jsonrpc package)
Code:
#!/bin/python

from jsonrpc import ServiceProxy
from jsonrpc.proxy import JSONRPCException
from jsonrpc.json import JSONDecodeException

RPC = ServiceProxy("http://%s:%s@%s:%s" % ('yourusername', 'yourpassword', '127.0.0.1', 8332))
try:
print "%s" % RPC.getbalance("*", 0)
except JSONRPCException, e:
print e.error['message']
except:
        pass

PHP: (requires jsonRPCClient Class)
Code:
<?php
         
require_once("jsonRPCClient.php");
         
$RPC = new jsonRPCClient("http://yourusername:yourpassword@127.0.0.1:8332");
         echo 
$RPC->getbalance("*"0);
?>


Feel like donating to me? BTC Address: 14eUVSgBSzLpHXGAfbN9BojXTWvTb91SHJ
TAiS46 (OP)
Full Member
***
Offline Offline

Activity: 222
Merit: 100



View Profile WWW
June 21, 2012, 08:31:47 AM
 #5

YES, thank you Smiley

You can also use the command line with

Code:
bitcoind getbalance "*" 0
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!