Commit 49257c0
committed
[net processing] Don't process mutated blocks
We preemptively perform a block mutation check before further processing
a block message (similar to early sanity checks on other messsage
types). The main reasons for this change are as follows:
- `CBlock::GetHash()` is a foot-gun without a prior mutation check, as
the hash returned only commits to the header but not to the actual
transactions (`CBlock::vtx`) contained in the block.
- We have observed attacks that abused mutated blocks in the past, which
could have been prevented by simply not processing mutated blocks
(e.g. bitcoin/bitcoin#27608).1 parent 2d8495e commit 49257c0
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4719 | 4719 | | |
4720 | 4720 | | |
4721 | 4721 | | |
| 4722 | + | |
| 4723 | + | |
| 4724 | + | |
| 4725 | + | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
4722 | 4732 | | |
4723 | 4733 | | |
4724 | 4734 | | |
| |||
4734 | 4744 | | |
4735 | 4745 | | |
4736 | 4746 | | |
4737 | | - | |
4738 | 4747 | | |
4739 | 4748 | | |
4740 | 4749 | | |
| |||
0 commit comments