Commit 0edabd4
committed
Add coinbase validation to Block::validate() with new error variants
Add validation checks to Block::validate() to ensure blocks have a valid coinbase:
- Check for empty transaction list (NoTransactions error)
- Verify first transaction is coinbase (InvalidCoinbase error)
The validation now happens during Block::validate() rather than requiring
every caller to check coinbase presence separately.1 parent ca4d87d commit 0edabd4
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| |||
405 | 413 | | |
406 | 414 | | |
407 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
408 | 420 | | |
409 | 421 | | |
410 | 422 | | |
| |||
418 | 430 | | |
419 | 431 | | |
420 | 432 | | |
| 433 | + | |
| 434 | + | |
421 | 435 | | |
422 | 436 | | |
423 | 437 | | |
| |||
0 commit comments