|
@@ -207,6 +207,21 @@ class SinglePassCreatedHandler:
|
|
|
self.channelmgr.perfstats)
|
|
|
# TODO: compute the index, check the VRF, ensure the
|
|
|
# SNIP is the correct one
|
|
|
+ pathsel_rand, next_blindkey = relay.Sphinx.client(
|
|
|
+ self.client_key, blinding_keys,
|
|
|
+ onionkey, b'pathsel',
|
|
|
+ nextlayer is None, self.channelmgr.perfstats)
|
|
|
+ if nextlayer is not None:
|
|
|
+ blinding_keys.append(next_blindkey)
|
|
|
+
|
|
|
+ index = int.from_bytes(relay.VRF.check_output(pathselkey,
|
|
|
+ pathsel_rand, vrfout,
|
|
|
+ self.channelmgr.perfstats)[:4],
|
|
|
+ 'big', signed=False)
|
|
|
+
|
|
|
+ indexrange = snip.snipdict["range"]
|
|
|
+ if index < indexrange[0] or index >= indexrange[1]:
|
|
|
+ logging.error("Incorrect SNIP received")
|
|
|
|
|
|
circhandler.circuit_descs.append(snip)
|
|
|
cell = nextlayer
|