Idx to 6 bytes (48 bits)

This commit is contained in:
arnaucube
2020-09-22 16:24:40 +02:00
parent c0336f485f
commit 06703aecad
11 changed files with 172 additions and 111 deletions

View File

@@ -46,12 +46,16 @@ func (s *StateDB) setIdxByEthAddrBJJ(idx common.Idx, addr ethCommon.Address, pk
}
k := concatEthAddrBJJ(addr, pk)
// store Addr&BJJ-idx
err = tx.Put(k, idx.Bytes())
idxBytes, err := idx.Bytes()
if err != nil {
return err
}
err = tx.Put(k, idxBytes[:])
if err != nil {
return err
}
// store Addr-idx
err = tx.Put(addr.Bytes(), idx.Bytes())
err = tx.Put(addr.Bytes(), idxBytes[:])
if err != nil {
return err
}