Skip to content

Commit

Permalink
DERO-HE STARGATE Testnet Release33
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDero committed Dec 1, 2021
1 parent 2388bdd commit 9300ef9
Show file tree
Hide file tree
Showing 497 changed files with 118,924 additions and 5,520 deletions.
1 change: 0 additions & 1 deletion blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,6 @@ func (chain *Blockchain) IS_TX_Valid(txhash crypto.Hash) (valid_blid crypto.Hash
for _, bltxhash := range bl.Tx_hashes {
if bltxhash == txhash {
exist_list = append(exist_list, blid)
//break , this is removed so as this case can be tested well
}
}
}
Expand Down
1 change: 1 addition & 0 deletions blockchain/hardcoded_sc/nameservice.bas
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// Register a name, limit names of 5 or less length
Function Register(name String) Uint64
10 IF EXISTS(name) THEN GOTO 50 // if name is already used, it cannot reregistered
15 IF STRLEN(name) >= 64 THEN GOTO 50 // skip names misuse
20 IF STRLEN(name) >= 6 THEN GOTO 40
30 IF SIGNER() == address_raw("deto1qyvyeyzrcm2fzf6kyq7egkes2ufgny5xn77y6typhfx9s7w3mvyd5qqynr5hx") THEN GOTO 40
35 IF SIGNER() != address_raw("deto1qy0ehnqjpr0wxqnknyc66du2fsxyktppkr8m8e6jvplp954klfjz2qqdzcd8p") THEN GOTO 50
Expand Down
30 changes: 15 additions & 15 deletions blockchain/miner_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,24 +249,24 @@ func (chain *Blockchain) Create_new_miner_block(miner_address rpc.Address) (cbl
}

if tx.IsProofRequired() && len(bl.Tips) == 2 {
if tx.BLID == bl.Tips[0] || tx.BLID == bl.Tips[1] {
if tx.BLID == bl.Tips[0] || tx.BLID == bl.Tips[1] { // delay txs by a block if they would collide
logger.V(8).Info("not selecting tx due to probable collision", "txid", tx_hash_list_sorted[i].Hash)
continue
}
} else {
version, err := chain.ReadBlockSnapshotVersion(tx.BLID)
if err != nil {
continue
}
hash, err := chain.Load_Merkle_Hash(version)
if err != nil {
continue
}
}

if hash != tx.Payloads[0].Statement.Roothash {
//return fmt.Errorf("Tx statement roothash mismatch expected %x actual %x", tx.Payloads[0].Statement.Roothash, hash[:])
continue
}
version, err := chain.ReadBlockSnapshotVersion(tx.BLID)
if err != nil {
continue
}
hash, err := chain.Load_Merkle_Hash(version)
if err != nil {
continue
}

if hash != tx.Payloads[0].Statement.Roothash {
//return fmt.Errorf("Tx statement roothash mismatch expected %x actual %x", tx.Payloads[0].Statement.Roothash, hash[:])
continue
}

if height-int64(tx.Height) < TX_VALIDITY_HEIGHT {
Expand Down Expand Up @@ -353,7 +353,7 @@ func ConvertBlockToMiniblock(bl block.Block, miniblock_miner_address rpc.Address

timestamp := uint64(globals.Time().UTC().UnixMilli())
mbl.Timestamp = uint16(timestamp) // this will help us better understand network conditions

mbl.PastCount = byte(len(bl.Tips))
for i := range bl.Tips {
mbl.Past[i] = binary.BigEndian.Uint32(bl.Tips[i][:])
Expand Down
16 changes: 15 additions & 1 deletion blockchain/storetopo.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,22 @@ func (chain *Blockchain) Find_Blocks_Height_Range(startheight, stopheight int64)
}
_, topos_end := chain.Store.Topo_store.binarySearchHeight(stopheight)

lowest := topos_start[0]
for _, t := range topos_start {
if t < lowest {
lowest = t
}
}

highest := topos_end[0]
for _, t := range topos_end {
if t > highest {
highest = t
}
}

blid_map := map[crypto.Hash]bool{}
for i := topos_start[0]; i <= topos_end[0]; i++ {
for i := lowest; i <= highest; i++ {
if toporecord, err := chain.Store.Topo_store.Read(i); err != nil {
panic(err)
} else {
Expand Down

0 comments on commit 9300ef9

Please sign in to comment.