Bitcoin Forum
May 06, 2024, 08:33:59 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
1714984439
Hero Member
*
Offline Offline

Posts: 1714984439

View Profile Personal Message (Offline)

Ignore
1714984439
Reply with quote  #2

1714984439
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714984439
Hero Member
*
Offline Offline

Posts: 1714984439

View Profile Personal Message (Offline)

Ignore
1714984439
Reply with quote  #2

1714984439
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!