@@ -68,14 +68,12 @@ revision number.
68
68
69
69
A party to a connection will speak all protocol versions in a range,
70
70
say 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 `.
73
71
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.
79
77
80
78
81
79
.. _script hashes :
@@ -144,23 +142,31 @@ Status
144
142
To calculate the `status ` of a :ref: `script hash <script hashes >` (or
145
143
address):
146
144
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).
150
147
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
152
152
``"tx_hash:height:" `` for each transaction in order, where:
153
153
154
154
* ``tx_hash `` is the transaction hash in hexadecimal
155
155
156
156
* ``height `` is the height of the block it is in.
157
157
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.
162
168
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
164
170
full string expressed as a hexadecimal string, or :const: `null ` if the
165
171
string is empty because there are no transactions.
166
172
0 commit comments