Commit 345c818
committed
Merge bitcoin#23630: Remove GetSpendHeight
fa3942f Remove GetSpendHeight (MarcoFalke)
Pull request description:
It is unclear what the goal of the helper is, as the caller already
knows the spend height before calling the helper.
Also, in case the coins view is corrupted, LookupBlockIndex will return
nullptr. Dereferencing a nullptr is UB.
Fix both issues by removing it. Also, add a sanity check, which aborts
if the coins view is corrupted.
ACKs for top commit:
laanwj:
Code review ACK fa3942f
ryanofsky:
Code review ACK fa3942f. I'm not aware of cases where coins GetBestBlock could be different from active chain tip, and asset seems sufficient to guarantee PR doesn't change behavior if that doesn't happen.
Tree-SHA512: 29f65d72e116ec5a4509e0947ceeaa5bb6b7dfd5d174d3c7945cb15fa266d590c4f8b48e6385de74ef7d7c84ebd2255de902ad9c87c24955348a91b12e5bffd52 files changed
+4
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
| 726 | + | |
| 727 | + | |
726 | 728 | | |
727 | 729 | | |
728 | 730 | | |
| |||
731 | 733 | | |
732 | 734 | | |
733 | 735 | | |
734 | | - | |
| 736 | + | |
| 737 | + | |
735 | 738 | | |
736 | 739 | | |
737 | 740 | | |
| |||
1311 | 1314 | | |
1312 | 1315 | | |
1313 | 1316 | | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | 1317 | | |
1323 | 1318 | | |
1324 | 1319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | 481 | | |
489 | 482 | | |
490 | 483 | | |
| |||
0 commit comments