Commit f91e4df
committed
[Refactoring] Skip expensive ContainsZerocoins/HasZerocoinSpendInputs
...calls in ConnectBlock when possible.
The check at line 2798 in CheckBlock ensures that no zc tx (either mint
or spend) is accepted in the chain after v5 activation.
`ContainsZerocoins`/`HasZerocoinSpendInputs` are expensive functions,
especially when they return `false` (as they need to go through all
inputs and outputs).
Therefore avoid the duplicated check in ConnectBlock, and, instead, use
the shortcut operator to skip HasZerocoinSpendInputs call after v5
enforcement.1 parent dd784bb commit f91e4df
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
1557 | | - | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1558 | 1555 | | |
1559 | 1556 | | |
1560 | 1557 | | |
| |||
0 commit comments