multi: update channel db HTLC OnionBlob to array
We know that onion blobs in lightning are _exactly_ 1366 bytes in lightning, but they are currently expressed as a byte slice in channeldb's HTLC struct. Blobs are currently serialized as var bytes, so we can take advantage of this known length and variable length to add additional data to the inline serialization of our HTLCs, which are otherwise not easily extensible (without creating a new bucket).
This commit is contained in:
9 files changed
+44
-19
No files matched your search
@@ -0,0 +1,16 @@
|
||||
package lnmock
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
)
|
||||
|
||||
// MockOnion returns a mock onion payload.
|
||||
func MockOnion() [lnwire.OnionPacketSize]byte {
|
||||
var onion [lnwire.OnionPacketSize]byte
|
||||
onionBlob := bytes.Repeat([]byte{1}, lnwire.OnionPacketSize)
|
||||
copy(onion[:], onionBlob)
|
||||
|
||||
return onion
|
||||
}
|
||||
Reference in new issue
Block a user