From 7d3ce833a71c6862a54f5387b41c07851b5b50b2 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 23 Oct 2015 22:00:04 -0700 Subject: [PATCH] fix off-by-one in main mix-header generation loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Mix info for the first hop wasn’t being calculated --- sphinx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx.go b/sphinx.go index be83c0b77..ebb74eebc 100644 --- a/sphinx.go +++ b/sphinx.go @@ -163,7 +163,7 @@ func NewMixHeader(dest LightningAddress, identifier [securityParameter]byte, // Now we compute the routing information for each hop, along with a // MAC of the routing info using the shared key for that hop. - for i := numHops - 2; i > 0; i-- { + for i := numHops - 2; i >= 0; i-- { // The next hop from the point of view of the current hop. Node // ID's are currently the hash160 of a node's pubKey serialized // in compressed format.