mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-17 16:21:44 +01:00
lnwire: all hashes within the protocol are now 32-bytes
We now enforce that the site of all revocation pre-images+hashes (used for HTLC’s) are now 32-bytes. Additionally, all payment pre-images are now required to be 32-bytes not he wire. There also exists a Script level enforcement of the payment pre-image size at a lower level. This commit serves to unify the sizes of all hashes/pre-images across the codebase.
This commit is contained in:
@@ -45,7 +45,7 @@ type HTLCAddRequest struct {
|
||||
// number of pre-images for each of the listed hashes. For regular HTLC's
|
||||
// this slice only has one hash. However, for "multi-sig" HTLC's, the
|
||||
// length of this slice should be N.
|
||||
RedemptionHashes [][20]byte
|
||||
RedemptionHashes [][32]byte
|
||||
|
||||
// OnionBlob is the raw serialized mix header used to route an HTLC in
|
||||
// a privacy-preserving manner. The mix header is defined currently to
|
||||
@@ -78,7 +78,7 @@ func (c *HTLCAddRequest) Decode(r io.Reader, pver uint32) error {
|
||||
// Expiry(4)
|
||||
// Amount(4)
|
||||
// ContractType(1)
|
||||
// RedemptionHashes (numOfHashes * 20 + numOfHashes)
|
||||
// RedemptionHashes (numOfHashes * 32 + numOfHashes)
|
||||
// OnionBlog
|
||||
err := readElements(r,
|
||||
&c.ChannelPoint,
|
||||
|
||||
Reference in New Issue
Block a user