“tx” messages Check syntactic correctness Reject if duplicate of block we have in any of the three categories Transaction list must be non-empty Block hash must satisfy claimed nBits proof of work Block timestamp must not be more than two hours in the future First transaction must be coinbase (i.e. only 1 input, with hash=0, For each transaction, apply “tx” checks 2-4 For the coinbase (first) transaction, scriptSig length must be 2-100 Reject if sum of transaction sig opcounts > MAX_BLOCK_SIGOPS Verify Merkle hash Check if prev block (matching prev hash) is in main branch or side Check that nBits value matches the difficulty rules. Reject if timestamp is the median time of the last 11 blocks or For certain old blocks (i.e. on initial block download) check that Add block into the tree. There are three cases: 1. block further For case 1, adding to main branch: For all but the coinbase transaction, apply the following: Reject if coinbase value > sum of block creation fee and transaction fees (If we have not rejected): For each transaction, “Add to wallet if mine” For each transaction in the block, delete any matching transaction from the transaction pool Relay block to our peers If we rejected, the block is not counted as part of the main branch For case 2, adding to a side branch, we don’t do anything. For case 3, a side branch becoming the main branch: Find the fork block on the main branch which this side branch forks off of. Redefine the main branch to only go up to this fork block. For each block on the side branch, from the child of the fork block to the leaf, add to the main branch: Do “branch” checks 3-11. For all but the coinbase transaction, apply the following: Reject if coinbase value > sum of block creation fee and transaction fees. (If we have not rejected): For each transaction, “Add to wallet if mine” If we reject at any point, leave the main branch as what it was originally, done with block. For each block in the old main branch, from the leaf down to the child of the fork block: For each block in the new main branch, from the child of the fork node to the leaf: Relay block to our peers For each orphan block for which this block is its prev, run all these steps (including this one) recursively on that orphan https://en.bitcoin.it/wiki/Protocol_rules nLockTime must not exceed 31 bits, as some clients will interpret it incorrectly. ↩︎ A valid transaction requires at least 100 bytes. If it’s any less, the transaction is not valid ↩︎ The number of signature operands in the signature (no, that is not redundant) for standard transactions will never exceed two. ↩︎ Note that this is not a hard requirement on clients. ↩︎ Note that this is not a hard requirement on clients. The network-enforced rule is that only one transaction spending a particular output can be in the blockchain, thus preventing double-spending. Technically miners can choose which one they want to put into the block they’re working on as long as no other transaction has spent that output either previously in the blockchain, or in the same block. The in-memory transaction pool can technically be managed in whatever way the miner is willing to implement. ↩︎ This is the protection against double-spending. ↩︎ Note that when the transaction is accepted into the memory pool, an additional check is made to ensure that the coinbase value does not exceed the transaction fees plus the expected BTC value (25BTC as of this writing). ↩︎
交易的处理过程
For each input, if the referenced output transaction is coinbase (i.e. only 1 input, with hash=0, n=-1), it must have at least COINBASE_MATURITY (100) confirmations; else reject this transaction区块的处理过程
n=-1), the rest must not be
branches. If not, add this to orphan blocks, then query peer we got
this from for 1st missing orphan block in prev chain;done with block
before
hash matches known values
extends the main branch; 2. block extends a side branch but does
not add enough difficulty to make it become the new main branch; 3.
block extends a side branch and makes it the new main branch.
注解
引用
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算