My question is how long does it take for a miner to validate account "balance" is sufficient to initiate the transfer so it can include it in a block and how does it do it? Does it iterates through the whole block chain and sums up the unspent outputs associated with the sender? Or it maintains an internal database that represents each member and their balances whose transaction was ever included in the block chain and once new transactions(a new block) is added to the block chain it updates its internal database?
I guess the second would be much faster than iterating through the whole block chain which is now over 100+ gigabyte.
I'm really interested in how the account balance is determined by the miners. Any help is appreciated. Thx