engine's local node is now index zero

This commit is contained in:
херетик
2023-01-31 16:09:12 +00:00
parent 103fe97b3f
commit 265cb6e7c2
13 changed files with 26 additions and 136 deletions

View File

@@ -14,7 +14,7 @@ func (eng *Engine) forward(on *forward.Layer, b slice.Bytes,
// forward the whole buffer received onwards. Usually there will be a
// crypt.Layer under this which will be unwrapped by the receiver.
if on.AddrPort.String() == eng.Node.AddrPort.String() {
if on.AddrPort.String() == eng.GetLocalNode().AddrPort.String() {
// it is for us, we want to unwrap the next part.
eng.handleMessage(BudgeUp(b, *c), on)
} else {
@@ -23,7 +23,7 @@ func (eng *Engine) forward(on *forward.Layer, b slice.Bytes,
sess := eng.FindSessionByHeader(on1.ToPriv)
if sess != nil {
eng.DecSession(sess.ID,
eng.RelayRate*lnwire.MilliSatoshi(len(b))/1024/1024,
eng.GetLocalNode().RelayRate*lnwire.MilliSatoshi(len(b))/1024/1024,
false, "forward")
}
}