Where/How does Bitcoin-qt check for receives to it's addresses?

0

How does Bitcoin-qt technically check for receives to it's own addresses. I know it has a list of addresses loaded in from the wallet.dat, but when a new block or new transaction arrives, what logic increments the wallet balance you see and how? I've been told that it uses some merkle tree stuff.

John T

Posted 2014-01-20T23:34:01.173

Reputation: 2 759

Answers

1

the Blockchain contains all necessary info to know the balance of every address, including "it's own". When it downloads the next block, it updates all known balances by adjusting them based on every transaction in the block. This repeats.

hedgedandlevered

Posted 2014-01-20T23:34:01.173

Reputation: 973

Are you saying the Bitcoin-qt keeps a database of all addresses every used in the blockchain?John T 2014-01-21T08:15:50.330

1Yes - that's why it takes so long to start up the first time. It is downloading all transactions ever (the blockchain). In this way it can operate on it's own (that's what decentralised means) and check it's own copy to know "the balance" (which for the record is the total of the unspent outputs at a particular address). It can do that for all addresses not just its own addressesT9b 2014-01-21T11:29:24.180