Use 48-bit commitment transaction numbers

Fix SetStateNumHint and GetStateNumHint to properly
set and get the stateNumHints using the lower 24 bits
of the locktime of the commitment transaction as the
lower 24 bits of the obfuscated state number and the
lower 24 bits of the sequence field as the higher 24
bits.
This commit is contained in:
Christopher Jämthagen
2017-01-04 16:15:50 +01:00
committed by Olaoluwa Osuntokun
parent e910b12d33
commit 873211c02f
5 changed files with 32 additions and 24 deletions

View File

@@ -571,7 +571,7 @@ func TestCommitTxStateHint(t *testing.T) {
copy(obsfucator[:], testHdSeed[:StateHintSize])
for i := 0; i < 10000; i++ {
stateNum := uint32(i)
stateNum := uint64(i)
err := SetStateNumHint(commitTx, stateNum, obsfucator)
if err != nil {