Post
Topic
Board Development & Technical Discussion
Re: How is an account/address balance calculated?
by
floe
on 25/05/2011, 15:17:04 UTC
1. Yep, that's how it works, kind of...
OK, so I got that right :-)

2. The only thing you're missing is that you don't need to go back through the entire chain- just to the previous transaction where it came under that address' control. Since every time you send coins it verifies that there is a tx where the coins came under your control, the block chain forms a transaction chain that is self building.

basically, you only need to look at the tx that gave the coins to the address that is spending them, not all the way back to generation- the blockchain already does that.
OK, I think I got that too. So scanning the entire block chain is only necessary if, say, you want to know the balance for an address that is not your own? Even then, you probably can scan backwards from the current block and stop when you've found all generation transactions.

Florian