peer: init link with batched sphinx processing

This commit is contained in:
Conner Fromknecht 2018-01-16 00:52:39 -08:00
parent b8254803be
commit 0e4be6a04a
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

@ -379,6 +379,7 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {
linkCfg := htlcswitch.ChannelLinkConfig{ linkCfg := htlcswitch.ChannelLinkConfig{
Peer: p, Peer: p,
DecodeHopIterator: p.server.sphinx.DecodeHopIterator, DecodeHopIterator: p.server.sphinx.DecodeHopIterator,
DecodeHopIterators: p.server.sphinx.DecodeHopIterators,
DecodeOnionObfuscator: p.server.sphinx.ExtractErrorEncrypter, DecodeOnionObfuscator: p.server.sphinx.ExtractErrorEncrypter,
GetLastChannelUpdate: createGetLastUpdate(p.server.chanRouter, GetLastChannelUpdate: createGetLastUpdate(p.server.chanRouter,
p.PubKey(), lnChan.ShortChanID()), p.PubKey(), lnChan.ShortChanID()),
@ -1272,6 +1273,7 @@ out:
linkConfig := htlcswitch.ChannelLinkConfig{ linkConfig := htlcswitch.ChannelLinkConfig{
Peer: p, Peer: p,
DecodeHopIterator: p.server.sphinx.DecodeHopIterator, DecodeHopIterator: p.server.sphinx.DecodeHopIterator,
DecodeHopIterators: p.server.sphinx.DecodeHopIterators,
DecodeOnionObfuscator: p.server.sphinx.ExtractErrorEncrypter, DecodeOnionObfuscator: p.server.sphinx.ExtractErrorEncrypter,
GetLastChannelUpdate: createGetLastUpdate(p.server.chanRouter, GetLastChannelUpdate: createGetLastUpdate(p.server.chanRouter,
p.PubKey(), newChanReq.channel.ShortChanID()), p.PubKey(), newChanReq.channel.ShortChanID()),