routing: remove redundant GetHash

This commit is contained in:
yyforyongyu
2024-09-28 11:15:14 +09:00
parent ce8cde6911
commit 46eb811543
2 changed files with 8 additions and 50 deletions

View File

@@ -488,17 +488,9 @@ func (p *paymentLifecycle) collectResult(attempt *channeldb.HTLCAttempt) (
log.Tracef("Collecting result for attempt %v", spew.Sdump(attempt))
// We'll retrieve the hash specific to this shard from the
// shardTracker, since it will be needed to regenerate the circuit
// below.
hash, err := p.shardTracker.GetHash(attempt.AttemptID)
if err != nil {
return p.failAttempt(attempt.AttemptID, err)
}
// Regenerate the circuit for this attempt.
_, circuit, err := generateSphinxPacket(
&attempt.Route, hash[:], attempt.SessionKey(),
&attempt.Route, attempt.Hash[:], attempt.SessionKey(),
)
// TODO(yy): We generate this circuit to create the error decryptor,
// which is then used in htlcswitch as the deobfuscator to decode the