Bitcoin Forum
May 09, 2024, 05:17:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC "GetBalance" when does it increment?  (Read 1099 times)
TangibleCryptography (OP)
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


Tangible Cryptography LLC


View Profile WWW
August 01, 2012, 02:09:11 PM
 #1

When does "GetBalance" increment?
When the bitcoind receives a 0-confirm tx, after 1 confirmation, after 6?
Can this be modified short of modifying the source code and recompiling?
1715275052
Hero Member
*
Offline Offline

Posts: 1715275052

View Profile Personal Message (Offline)

Ignore
1715275052
Reply with quote  #2

1715275052
Report to moderator
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.
1715275052
Hero Member
*
Offline Offline

Posts: 1715275052

View Profile Personal Message (Offline)

Ignore
1715275052
Reply with quote  #2

1715275052
Report to moderator
1715275052
Hero Member
*
Offline Offline

Posts: 1715275052

View Profile Personal Message (Offline)

Ignore
1715275052
Reply with quote  #2

1715275052
Report to moderator
1715275052
Hero Member
*
Offline Offline

Posts: 1715275052

View Profile Personal Message (Offline)

Ignore
1715275052
Reply with quote  #2

1715275052
Report to moderator
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
August 01, 2012, 02:36:54 PM
 #2

When does "GetBalance" increment?
When the bitcoind receives a 0-confirm tx, after 1 confirmation, after 6?
Can this be modified short of modifying the source code and recompiling?

Had to ask sipa for the answer:  1 for external transactions, 0 for change or send-to-self ones


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
August 01, 2012, 02:51:09 PM
 #3

Ah.  No wonder why I couldn't figure it out.  I first assumed it was 0 but then I noticed a delay so I figured it was 1 but that wasn't always consistent.  I didn't think of the possibility that "from self" would be handled differently.

So that leads me to my followup question.  It isn't possible to "spend" 0-confirm tx with bitcoind?  The protocol allows it.
If bitcoind doesn't increment until 1 confirmation it will error out (insufficient funds) until 1-confirm is detected and it it increments.

Thus bitcoind is more conservative than the protocol?  I guess this behavior can't be overriden without modifying the source.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
August 01, 2012, 03:13:20 PM
 #4

There are many ways that the bitcoin software is more conservative than the protocol Smiley

Only relaying standard transactions is another well-known example...


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Foxpup
Legendary
*
Offline Offline

Activity: 4354
Merit: 3044


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
August 02, 2012, 08:18:38 PM
 #5

So that leads me to my followup question.  It isn't possible to "spend" 0-confirm tx with bitcoind?  The protocol allows it.
0-confirm transactions can only be spent if they came from yourself (change or send-to-self), since bitcoind doesn't "trust" transactions from other sources until they have at least 1 confirmation. This rule came about after one version of Bitcoin had a bug that caused it to sometimes send transactions with insufficient fees, which would therefore never be confirmed. Normally this would be no big deal, except that other clients simply accepted these transactions and spent them, creating even more transactions which would never confirm, which would be spent again, and so on ad infinitum, until finally everyone's transactions were getting stuck because everyone's wallets were filled with coins that were never going to confirm. It was a real mess.

So now Bitcoin will only trust other people's transactions if they have at least one confirmation, which is the way it should be. The old way of just trusting all transactions, confirmed or not, never really made sense, since the whole point of distinguishing between confirmed and unconfirmed transactions in the first place is that unconfirmed transactions can't be trusted (eg, they may yet be double-spent, while confirmed transactions cannot (at least, not without a lot of further discussion)).

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
August 05, 2012, 03:28:11 PM
 #6

If you really need to override this behavior, you should be able to use the raw transaction API.

Also, the client won't include generated coins in the balance or new transactions until 120 blocks have passed.  I just mention it for completeness.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
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!