htlcswitch: add docs for circuit bucket hierarchy

This commit is contained in:
yyforyongyu
2021-07-22 20:40:36 +08:00
parent c74c1d0f51
commit e513057eae

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")
) )