比特幣學習-Transaction的locktime屬性


Locktime, also known as nLockTime from the variable name used in the reference client, defines the earliest time that a transaction is valid and can be relayed on the network or added to the block chain. It is set to zero in most transactions to indicate immediate propagation and execution. If locktime is nonzero and below 500 million, it is interpreted as a block height, meaning the transaction is not valid and is not relayed or included in the blockchain prior to the specified block height. If it is above 500 million, it is interpreted as a Unix Epoch timestamp (seconds since Jan-1-1970) and the transaction is not valid prior to the specified time. Transactions with locktime specifying a future block or time must be held by the originating system and transmitted to the bitcoin network only after they become valid. The use of locktime is equivalent to postdating a paper check. 

 

Locktime, 也被稱為nLockTime, 它定義了個最早時間,只有過了這個最早時間,這個transaction可以被發送到比特幣網絡。通常被設置為0,表示transaction一創建好就馬上發送到比特幣網絡。如果nLocktime的時間在1到5億之間,則表示該transaction只會被添加到區塊高度大於或等於nLocktime的區塊中去。如果nLocktime的值超過5億,則表示從1970年01月01日開始算,加上nLocktime 秒之后的一個時間點,如果transaction被創建的時間早於那個時間點,則該transaction不會被發送到比特幣網路。帶locktime的transaction,指明了transactions在未來的一個區塊或者未來的一個時間點,才會被驗證並發送到比特幣網絡上去。……


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM