2
Both transactions and blocks have a time field when you use Bitcoin's getblock or gettransaction methods. The API method list defines the transaction time as " time the transaction occurred".
Is this the time the transaction or block arrived at my client? Or is this time defined by the sender of the transaction or block?
I tried to encode a transaction to a raw transaction and decode it again afterwards, but the lock_time property is set to 0 when I do this.
The reason for this question is that I want to make sure that when you check all transactions twice, all new ones of the second check have a time value higher than the highest one of the first check.
So you say that when a transaction gets confirmed, the time value changes to the block time value? – Steven Roose – 2013-05-02T23:19:27.760
1That's client specific behavior, as transaction times play no role in the bitcoin network. But yeah, in this case that seems likely. Test it yourself though: go to blockchain.info, pick a few transactions that are currently unconfirmed and get the time value for them. Then get them again in like an hour or so. – Tom van der Woerdt – 2013-05-02T23:33:50.427
@TomvanderWoerdt, But doesn't that mean that every single node will have different timestamps because they receive the broadcast at different times? – Pacerier – 2014-05-23T14:02:55.840
@Pacerier Yes, it does – Tom van der Woerdt – 2014-05-23T16:31:03.423
@TomvanderWoerdt, Please also see http://bitcoin.stackexchange.com/q/25542/1475
– Pacerier – 2014-05-23T16:32:14.507