Commit 01af278
refactor: return std::optional<uint256> from ReadBlockFromDisk(FlatFilePos)
Replace the uint256* hash_out output parameter with a std::optional
return value. The optional is empty on failure, contains the block hash
on success. This makes the hash lifetime explicit and eliminates the
risk of dangling pointers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 89d8c45 commit 01af278
3 files changed
Lines changed: 15 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
| 748 | + | |
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
| 756 | + | |
756 | 757 | | |
757 | 758 | | |
758 | 759 | | |
759 | 760 | | |
760 | 761 | | |
761 | 762 | | |
762 | | - | |
| 763 | + | |
| 764 | + | |
763 | 765 | | |
764 | 766 | | |
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
768 | | - | |
| 770 | + | |
| 771 | + | |
769 | 772 | | |
770 | | - | |
771 | 773 | | |
772 | | - | |
| 774 | + | |
773 | 775 | | |
774 | 776 | | |
775 | 777 | | |
776 | 778 | | |
777 | 779 | | |
778 | 780 | | |
779 | | - | |
780 | | - | |
| 781 | + | |
| 782 | + | |
781 | 783 | | |
782 | 784 | | |
783 | | - | |
| 785 | + | |
784 | 786 | | |
785 | 787 | | |
786 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
224 | | - | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5185 | 5185 | | |
5186 | 5186 | | |
5187 | 5187 | | |
5188 | | - | |
5189 | | - | |
| 5188 | + | |
| 5189 | + | |
5190 | 5190 | | |
5191 | 5191 | | |
5192 | 5192 | | |
| |||
0 commit comments