mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-12-23 07:08:13 +00:00
Made changes to ch08.asciidoc
This commit is contained in:
parent
4c7cdced35
commit
a93c8e17e2
@ -92,24 +92,24 @@ However, before forwarding transactions to its neighbors, every bitcoin node tha
|
||||
|
||||
Each node verifies every transaction against a long checklist of criteria:
|
||||
|
||||
* The transaction's syntax and data structure must be correct
|
||||
* Neither lists of inputs or outputs are empty
|
||||
* The transaction size in bytes is less than +MAX_BLOCK_SIZE+
|
||||
* Each output value, as well as the total, must be within the allowed range of values (less than 21m coins, more than 0)
|
||||
* None of the inputs have hash=0, N=–1 (coinbase transactions should not be relayed)
|
||||
* +nLockTime+ is less than or equal to +INT_MAX+
|
||||
* The transaction size in bytes is greater than or equal to 100
|
||||
* The number of signature operations contained in the transaction is less than the signature operation limit
|
||||
* The unlocking script (+scriptSig+) can only push numbers on the stack, and the locking script (+scriptPubkey+) must match +isStandard+ forms (this rejects "nonstandard" transactions)
|
||||
* A matching transaction in the pool, or in a block in the main branch, must exist
|
||||
* For each input, if the referenced output exists in any other transaction in the pool, reject this transaction
|
||||
* The transaction's syntax and data structure must be correct.
|
||||
* Neither lists of inputs or outputs are empty.
|
||||
* The transaction size in bytes is less than +MAX_BLOCK_SIZE+.
|
||||
* Each output value, as well as the total, must be within the allowed range of values (less than 21m coins, more than 0).
|
||||
* None of the inputs have hash=0, N=–1 (coinbase transactions should not be relayed).
|
||||
* +nLockTime+ is less than or equal to +INT_MAX+.
|
||||
* The transaction size in bytes is greater than or equal to 100.
|
||||
* The number of signature operations contained in the transaction is less than the signature operation limit.
|
||||
* The unlocking script (+scriptSig+) can only push numbers on the stack, and the locking script (+scriptPubkey+) must match +isStandard+ forms (this rejects "nonstandard" transactions).
|
||||
* A matching transaction in the pool, or in a block in the main branch, must exist.
|
||||
* For each input, if the referenced output exists in any other transaction in the pool, reject this transaction.
|
||||
* For each input, look in the main branch and the transaction pool to find the referenced output transaction. If the output transaction is missing for any input, this will be an orphan transaction. Add to the orphan transactions pool, if a matching transaction is not already in the pool.
|
||||
* For each input, if the referenced output transaction is a coinbase output, it must have at least +COINBASE_MATURITY+ (100) confirmations
|
||||
* For each input, the referenced output must exist and cannot already be spent
|
||||
* Using the referenced output transactions to get input values, check that each input value, as well as the sum, are in the allowed range of values (less than 21m coins, more than 0)
|
||||
* Reject if the sum of input values < sum of output values
|
||||
* Reject if transaction fee would be too low to get into an empty block
|
||||
* The unlocking scripts for each input must validate against the corresponding output locking scripts
|
||||
* For each input, if the referenced output transaction is a coinbase output, it must have at least +COINBASE_MATURITY+ (100) confirmations.
|
||||
* For each input, the referenced output must exist and cannot already be spent.
|
||||
* Using the referenced output transactions to get input values, check that each input value, as well as the sum, are in the allowed range of values (less than 21m coins, more than 0).
|
||||
* Reject if the sum of input values < sum of output values.
|
||||
* Reject if transaction fee would be too low to get into an empty block.
|
||||
* The unlocking scripts for each input must validate against the corresponding output locking scripts.
|
||||
|
||||
These conditions can be seen in detail in the functions +AcceptToMemoryPool+, +CheckTransaction+, and +CheckInputs+ in the bitcoin reference client. Note that the conditions change over time, to address new types of Denial-of-Service attacks or sometimes to relax the rules so as to include more types of transactions.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user