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:
Olaoluwa Osuntokun
2016-06-30 11:53:11 -07:00
parent fd02c1c1aa
commit bba9b665ef
10 changed files with 29 additions and 23 deletions

View File

@@ -15,6 +15,13 @@ import (
// Common variables and functions for the message tests
var (
revHash = [32]byte{
0xb7, 0x94, 0x38, 0x5f, 0x2d, 0x1e, 0xf7, 0xab,
0x4d, 0x92, 0x73, 0xd1, 0x90, 0x63, 0x81, 0xb4,
0x4f, 0x2f, 0x6f, 0x25, 0x88, 0xa3, 0xef, 0xb9,
0x6a, 0x49, 0x18, 0x83, 0x31, 0x98, 0x47, 0x53,
}
// For debugging, writes to /dev/shm/
// Maybe in the future do it if you do "go test -v"
WRITE_FILE = false