@@ -68,14 +68,12 @@ revision number.
6868
6969A party to a connection will speak all protocol versions in a range,
7070say from `protocol_min ` to `protocol_max `, which may be the same.
71- When a connection is made, both client and server must initially
72- assume the protocol to use is their own `protocol_min `.
7371
74- The client should send a :func: `server.version ` RPC call as early as
75- possible in order to negotiate the precise protocol version; see its
76- description for more detail. All responses received in the stream
77- from and including the server's response to this call will use its
78- negotiated protocol version.
72+ The client must send a :func: `server.version ` RPC call as the first
73+ message on the wire, in order to negotiate the precise protocol
74+ version; see its description for more detail.
75+ All responses received in the stream from and including the server's
76+ response to this call will use its negotiated protocol version.
7977
8078
8179.. _script hashes :
@@ -144,23 +142,31 @@ Status
144142To calculate the `status ` of a :ref: `script hash <script hashes >` (or
145143address):
146144
147- 1. order confirmed transactions to the script hash by increasing
148- height (and position in the block if there are more than one in a
149- block)
145+ 1. Consider all transactions touching the script hash (both those spending
146+ from it, and those funding it), both confirmed and unconfirmed (in mempool).
150147
151- 2. form a string that is the concatenation of strings
148+ 2. Order confirmed transactions by increasing height (and position in the
149+ block if there are more than one in a block).
150+
151+ 3. form a string that is the concatenation of strings
152152``"tx_hash:height:" `` for each transaction in order, where:
153153
154154 * ``tx_hash `` is the transaction hash in hexadecimal
155155
156156 * ``height `` is the height of the block it is in.
157157
158- 3. Next, with mempool transactions in any order, append a similar
159- string for those transactions, but where **height ** is ``-1 `` if the
160- transaction has at least one unconfirmed input, and ``0 `` if all
161- inputs are confirmed.
158+ 4. For mempool transactions, we define **height ** to be ``-1 `` if the
159+ transaction has at least one unconfirmed input, and ``0 `` if all inputs are
160+ confirmed.
161+
162+ 5. Order mempool transactions by ``(-height, tx_hash) ``, that is,
163+ ``0 `` height txs come before ``-1 `` height txs, and secondarily the
164+ txid (in network byteorder) is used to arrive at a canonical ordering.
165+
166+ 6. Next, with mempool transactions in the specified order, append a similar
167+ strin.
162168
163- 4 . The :dfn: `status ` of the script hash is the :func: `sha256 ` hash of the
169+ 7 . The :dfn: `status ` of the script hash is the :func: `sha256 ` hash of the
164170full string expressed as a hexadecimal string, or :const: `null ` if the
165171string is empty because there are no transactions.
166172
0 commit comments