Bitcoin Forum

Other => Beginners & Help => Topic started by: IcedChai on November 18, 2012, 03:47:49 AM



Title: new vs updated transactions (source code question)
Post by: IcedChai on November 18, 2012, 03:47:49 AM
I'm looking at the bitcoind source, specifically CWallet::AddToWallet in wallet.cpp.

I see a reference to new or updated transactions: fInsertedNew or fUpdated, etc.

New transactions make sense, but under what circumstances is a transaction "updated"?

Thanks,
Dave

PS. I'm new here but have been experimenting with bitcoin on and off for a couple years.


Title: Re: new vs updated transactions (source code question)
Post by: CIYAM on November 18, 2012, 03:55:45 AM
I am pretty sure that tx "updates" will be required whenever a blockchain re-org occurs (which is not uncommon).

Understand that if two new "solved" blocks are broadcast at around the same time then your client will initially decide to use the first block it sees, however, if the next block you see connects to the "other" solution then all the tx's in the block that was first accepted now have to be considered as invalid. It is likely that many of those same tx's will be now included in the new blocks (thus information such as the "hashBlock" would need to be updated).