Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: zforum69 on July 08, 2017, 01:30:08 PM



Title: Possible intermittent bug with lock time
Post by: zforum69 on July 08, 2017, 01:30:08 PM
I have been using Bitcoin Core 0.14.2 and been experimenting with sending transactions via the GUI.  When I examined all my transactions the Lock Time was always the last block in the block chain at the time, as you would expect.  However in one transaction the Lock Time was set to 77 blocks behind the current block height at the time.  Can anybody shed some what happened with this transaction as I did everything via the GUI and there doesn't seem to be anyway to specify the Lock Time, let alone a value that is much less than the current block height? .... is this a bug?

Transaction
aef595e2b0208aea18f57b366a5c7f2feac22b7833a16af7d947964bd4a4522e

Summary
Size    192 (bytes)
Received Time    2017-07-08 06:40:56
Lock Time    Block: 474675
Included In Blocks    474754 ( 2017-07-08 06:53:06 + 12 minutes )
Confirmations    33 Confirmations
Relayed by IP    188.65.213.48 (whois)

At the time the transaction was received the block height was 474752 (solved: 2017-07-08 06:40:21)

Z


Title: Re: Possible intermittent bug with lock time
Post by: ranochigo on July 08, 2017, 02:13:16 PM
It's not a bug, its actually a feature.

In the wallet.cpp, there is a part where the inclusion of nlocktime by default is explained[1], there is also a part where it explains the rationale for choosing a locktime that is behind the current block height.[2] It helps with the privacy so that it is harder for people to track you if you have a high latency network etc.


[1] https://github.com/bitcoin/bitcoin/blob/fb0ac482eee761ec17ed2c11df11e054347a026d/src/wallet/wallet.cpp#L2133
[2] https://github.com/bitcoin/bitcoin/blob/fb0ac482eee761ec17ed2c11df11e054347a026d/src/wallet/wallet.cpp#L2159


Title: Re: Possible intermittent bug with lock time
Post by: zforum69 on July 09, 2017, 11:47:24 AM
Thanks for the explanation and links.

Z