Skip to content

Commit

Permalink
DERO-HE STARGATE Testnet Release26
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDero committed Nov 21, 2021
1 parent 81bc28a commit ac9d125
Show file tree
Hide file tree
Showing 209 changed files with 22,678 additions and 1,045 deletions.
18 changes: 13 additions & 5 deletions block/miniblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,20 @@ func (mbl *MiniBlock) Deserialize(buf []byte) (err error) {
copy(mbl.Nonce[:], buf[15+16+32:])
mbl.Height = int64(binary.BigEndian.Uint64(mbl.Check[:]))

if mbl.GetMiniID() == mbl.Past[0] {
return fmt.Errorf("Self Collision")
return
}

// checks for basic sanity
func (mbl *MiniBlock) IsSafe() bool {
id := mbl.GetMiniID()
if id == mbl.Past[0] {
//return fmt.Errorf("Self Collision")
return false
}
if mbl.PastCount == 2 && mbl.GetMiniID() == mbl.Past[1] {
return fmt.Errorf("Self Collision")
if mbl.PastCount == 2 && id == mbl.Past[1] {
//return fmt.Errorf("Self Collision")
return false
}

return
return true
}
2 changes: 1 addition & 1 deletion block/miniblockdag.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (c *MiniBlocksCollection) Get(id uint32) (mbl MiniBlock) {
var ok bool

if mbl, ok = c.Collection[id]; !ok {
panic("past should be present")
panic("id requested should be present")
}
return mbl
}
Expand Down

0 comments on commit ac9d125

Please sign in to comment.