Skip to content

Commit

Permalink
DERO-HE STARGATE Mainnet Release50
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDero committed Mar 18, 2022
1 parent b9ab381 commit 63f1884
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ func (chain *Blockchain) Add_TX_To_Pool(tx *transaction.Transaction) error {
if tx.IsRegistration() { // registration tx will not go any forward

tx_hash := tx.GetHash()
if chain.simulator == false && !(tx_hash[0] == 0 && tx_hash[1] == 0 && tx_hash[2] <= 0x3) {
if chain.simulator == false && !(tx_hash[0] == 0 && tx_hash[1] == 0 && tx_hash[2] == 0) {
return fmt.Errorf("TX doesn't solve Pow")
}

Expand Down
29 changes: 22 additions & 7 deletions cmd/dero-wallet-cli/easymenu_post_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import "os"
import "time"
import "fmt"
import "errors"

import "runtime"
import "strings"

import "path/filepath"
Expand Down Expand Up @@ -134,15 +134,30 @@ func handle_easymenu_post_open_command(l *readline.Instance, line string) (proce
fmt.Fprintf(l.Stderr(), "This will take a couple of minutes.Please wait....\n")

var reg_tx *transaction.Transaction
for {

reg_tx = wallet.GetRegistrationTX()
hash := reg_tx.GetHash()
successful_regs := make(chan *transaction.Transaction)

if hash[0] == 0 && hash[1] == 0 && hash[2] <= 0x3 {
break
}
counter := 0

for i := 0; i < runtime.GOMAXPROCS(0); i++ {
go func() {

for counter == 0 {

lreg_tx := wallet.GetRegistrationTX()
hash := lreg_tx.GetHash()

if hash[0] == 0 && hash[1] == 0 && hash[2] == 0 {
successful_regs <- lreg_tx
counter++
break
}
}
}()
}

reg_tx = <-successful_regs

fmt.Fprintf(l.Stderr(), "Registration TXID %s\n", reg_tx.GetHash())
err := wallet.SendTransaction(reg_tx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ import "github.com/blang/semver/v4"

// right now it has to be manually changed
// do we need to include git commitsha??
var Version = semver.MustParse("3.4.138-49.DEROHE.STARGATE+10032022")
var Version = semver.MustParse("3.4.141-50.DEROHE.STARGATE+18032022")
4 changes: 2 additions & 2 deletions p2p/peer_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ func get_peer_list_specific(addr string) (peers []Peer_Info) {
plist := get_peer_list()
sort.SliceStable(plist, func(i, j int) bool { return plist[i].Addr < plist[j].Addr })

if len(plist) <= 7 {
if len(plist) <= 31 {
peers = plist
} else {
index := sort.Search(len(plist), func(i int) bool { return plist[i].Addr < addr })
for i := range plist {
peers = append(peers, plist[(i+index)%len(plist)])
if len(peers) >= 7 {
if len(peers) >= 31 {
break
}
}
Expand Down
8 changes: 6 additions & 2 deletions walletapi/daemon_communication.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,9 +961,13 @@ func (w *Wallet_Memory) synchistory_block(scid crypto.Hash, topo int64) (err err
//fmt.Printf("decoding encrypted payload %x\n",tx.Payloads[t].RPCPayload)
crypto.EncryptDecryptUserData(crypto.Keccak256(shared_key[:], w.GetAddress().PublicKey.EncodeCompressed()), tx.Payloads[t].RPCPayload)
//fmt.Printf("decoded plaintext payload %x\n",tx.Payloads[t].RPCPayload)
sender_idx := uint(tx.Payloads[t].RPCPayload[0])

if sender_idx <= uint(tx.Payloads[t].Statement.RingSize) {
// if ring size is 2, the other party is the sender so mark it so
if uint(tx.Payloads[t].Statement.RingSize) == 2 {
sender_idx := 0
if j == 0 {
sender_idx = 1
}
addr := rpc.NewAddressFromKeys((*crypto.Point)(tx.Payloads[t].Statement.Publickeylist[sender_idx]))
addr.Mainnet = w.GetNetwork()
entry.Sender = addr.String()
Expand Down

0 comments on commit 63f1884

Please sign in to comment.