Bitcoin Forum
December 16, 2017, 11:24:45 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: bitcoind getbalance with minconf = 0  (Read 3808 times)
TAiS46
Full Member
***
Offline Offline

Activity: 222



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

Posts: 1513466685

View Profile Personal Message (Offline)

Ignore
1513466685
Reply with quote  #2

1513466685
Report to moderator
1513466685
Hero Member
*
Offline Offline

Posts: 1513466685

View Profile Personal Message (Offline)

Ignore
1513466685
Reply with quote  #2

1513466685
Report to moderator
Creating a Bitcoin client that fully implements the network protocol is extremely difficult. Bitcoin-Qt is the only known safe implementation of a full node. Some other projects attempt to compete, but it is not recommended to use such software for anything serious. (Lightweight clients like Electrum and MultiBit are OK.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742



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

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



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
Full Member
***
Offline Offline

Activity: 222



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:  

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!