Commit 7e86255
committed
Avoid parsing
`PublicKey` parsing is relatively expensive as we have to check if
the point is actually on the curve. To avoid it, our `NetworkGraph`
uses `NodeId`s which don't have the validity requirement.
Sadly, we were always parsing the broadcasting node's `PublicKey`
from the `node_id` in the network graph whenever we see an update
for that channel, whether we have a corresponding signature or not.
Here we fix this, only parsing the public key (and hashing the
message) if we're going to check a signature.PublicKeys when applying an unsigned chan update1 parent 1434e9c commit 7e86255
1 file changed
+16
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2537 | 2537 | | |
2538 | 2538 | | |
2539 | 2539 | | |
2540 | | - | |
| 2540 | + | |
2541 | 2541 | | |
2542 | 2542 | | |
2543 | 2543 | | |
| |||
2556 | 2556 | | |
2557 | 2557 | | |
2558 | 2558 | | |
2559 | | - | |
2560 | | - | |
2561 | | - | |
2562 | | - | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
2563 | 2565 | | |
2564 | 2566 | | |
2565 | 2567 | | |
2566 | 2568 | | |
2567 | | - | |
2568 | 2569 | | |
2569 | | - | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
2570 | 2579 | | |
2571 | 2580 | | |
2572 | 2581 | | |
| |||
0 commit comments