htlcswitch: add docs for circuit bucket hierarchy

This commit is contained in:
yyforyongyu committed 2021-09-23 13:22:34 +08:00
1 parent c74c1d0f51
commit e513057eae
1 file changed
+20
+20
View File
@@ -137,11 +137,31 @@ var (
// a packet to the source link, potentially including an error // a packet to the source link, potentially including an error
// encrypter for applying this hop's encryption to the payload in the // encrypter for applying this hop's encryption to the payload in the
// reverse direction. // reverse direction.
//
// Bucket hierarchy:
//
// circuitAddKey(root-bucket)
// |
// |-- <incoming-circuit-key>: <encoded bytes of PaymentCircuit>
// |-- <incoming-circuit-key>: <encoded bytes of PaymentCircuit>
// |
// ...
//
circuitAddKey = []byte("circuit-adds") circuitAddKey = []byte("circuit-adds")
// circuitKeystoneKey is used to retrieve the bucket containing circuit // circuitKeystoneKey is used to retrieve the bucket containing circuit
// keystones, which are set in place once a forwarded packet is // keystones, which are set in place once a forwarded packet is
// assigned an index on an outgoing commitment txn. // assigned an index on an outgoing commitment txn.
//
// Bucket hierarchy:
//
// circuitKeystoneKey(root-bucket)
// |
// |-- <outgoing-circuit-key>: <incoming-circuit-key>
// |-- <outgoing-circuit-key>: <incoming-circuit-key>
// |
// ...
//
circuitKeystoneKey = []byte("circuit-keystones") circuitKeystoneKey = []byte("circuit-keystones")
) )