From 7f180ddbae7cef17354f8ede8c7b8e4a7da48ba5 Mon Sep 17 00:00:00 2001 From: Captain Date: Sun, 27 Feb 2022 06:29:52 +0000 Subject: [PATCH] DERO-HE STARGATE Mainnet Release45 --- astrobwt/astrobwt.go | 10 ++++++++++ cmd/derod/rpc/websocket_getwork_server.go | 1 + cmd/explorer/explorerlib/templates/footer.tmpl | 2 +- config/version.go | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/astrobwt/astrobwt.go b/astrobwt/astrobwt.go index 7dc5b99..cabbf38 100644 --- a/astrobwt/astrobwt.go +++ b/astrobwt/astrobwt.go @@ -2,6 +2,7 @@ package astrobwt import "fmt" import "unsafe" +import "crypto/rand" import "encoding/binary" import "golang.org/x/crypto/sha3" import "golang.org/x/crypto/salsa20/salsa" @@ -13,6 +14,15 @@ var x = fmt.Sprintf const stage1_length int = 9973 // it is a prime func POW16(inputdata []byte) (outputhash [32]byte) { + + defer func() { + if r := recover(); r != nil { // if something happens due to RAM issues in miner, we should continue, system will crash sooner or later + var buf [16]byte + rand.Read(buf[:]) + outputhash = sha3.Sum256(buf[:]) // return a falsified has which will fail the check + } + }() + var counter [16]byte key := sha3.Sum256(inputdata) diff --git a/cmd/derod/rpc/websocket_getwork_server.go b/cmd/derod/rpc/websocket_getwork_server.go index 9f9eab6..b3e7adb 100644 --- a/cmd/derod/rpc/websocket_getwork_server.go +++ b/cmd/derod/rpc/websocket_getwork_server.go @@ -119,6 +119,7 @@ func SendJob() { if !v.valid_address && !chain.IsAddressHashValid(false, v.address_sum) { params.LastError = "unregistered miner or you need to wait 15 mins" } else { + params.LastError = "" v.valid_address = true } params.Blockhashing_blob = fmt.Sprintf("%x", mbl.Serialize()) diff --git a/cmd/explorer/explorerlib/templates/footer.tmpl b/cmd/explorer/explorerlib/templates/footer.tmpl index 8c1dd04..3c40e8b 100644 --- a/cmd/explorer/explorerlib/templates/footer.tmpl +++ b/cmd/explorer/explorerlib/templates/footer.tmpl @@ -4,7 +4,7 @@ DERO explorer source code | explorer version (api): under development (1.0) | dero version: golang pre-alpha - | Copyright 2017-2021 Dero Project + | Copyright 2017-2022 Dero Project diff --git a/config/version.go b/config/version.go index 386187c..6263d89 100644 --- a/config/version.go +++ b/config/version.go @@ -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.118-0.DEROHE.STARGATE+26022022") +var Version = semver.MustParse("3.4.120-0.DEROHE.STARGATE+26022022")