Commit ca4d87d
committed
Change Block::coinbase() to return &Coinbase instead of Option<&Transaction>
This change has semantic meaning: it guarantees that every checked Block
has a coinbase as its first transaction. The method is now infallible
for validated blocks.
As a follow-up, update bip34_block_height to work with the new Coinbase type:
- Removed unnecessary error handling, since coinbase() now returns
&Coinbase instead of Option<&Transaction>.
- Used cb.inner() to access the underlying Transaction fields for input
processing.1 parent 7c438b2 commit ca4d87d
2 files changed
+21
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
261 | | - | |
262 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
263 | 267 | | |
264 | 268 | | |
265 | 269 | | |
| |||
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
296 | | - | |
297 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
298 | 304 | | |
299 | 305 | | |
300 | 306 | | |
| |||
311 | 317 | | |
312 | 318 | | |
313 | 319 | | |
314 | | - | |
315 | | - | |
| 320 | + | |
| 321 | + | |
316 | 322 | | |
317 | 323 | | |
318 | 324 | | |
| |||
539 | 545 | | |
540 | 546 | | |
541 | 547 | | |
542 | | - | |
| 548 | + | |
543 | 549 | | |
544 | 550 | | |
545 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1182 | 1190 | | |
1183 | 1191 | | |
1184 | 1192 | | |
| |||
0 commit comments