DERO Homomorphic Encryption Testnet Release8

This commit is contained in:
Captain 2020-12-30 14:04:48 +00:00
parent 0d393224ec
commit c05c895a1f
No known key found for this signature in database
GPG Key ID: 18CDB3ED5E85D2D4
3 changed files with 21 additions and 5 deletions

View File

@ -230,7 +230,7 @@ func Blockchain_Start(params map[string]interface{}) (*Blockchain, error) {
// logger.Fatalf("Testing complete quitting") // logger.Fatalf("Testing complete quitting")
//go clean_up_valid_cache() // clean up valid cache go clean_up_valid_cache() // clean up valid cache
/* txlist := chain.Mempool.Mempool_List_TX() /* txlist := chain.Mempool.Mempool_List_TX()
for i := range txlist { for i := range txlist {
@ -1501,7 +1501,7 @@ func (chain *Blockchain) Rewind_Chain(rewind_count int) (result bool) {
panic(err) panic(err)
} }
if chain.IsBlockSyncBlockHeight(r.BLOCK_ID) || r.Height == 0 { if chain.IsBlockSyncBlockHeight(r.BLOCK_ID) || r.Height == 1 {
break break
} }

View File

@ -105,14 +105,14 @@ func (chain *Blockchain) Verify_Transaction_Coinbase(cbl *block.Complete_Block,
if _, err := balance_tree.Get(minertx.MinerAddress[:]); err != nil { if _, err := balance_tree.Get(minertx.MinerAddress[:]); err != nil {
//logger.Infof("balance not obtained err %s\n",err) //logger.Infof("balance not obtained err %s\n",err)
return false //return false
} else { } else {
return true return true
} }
} }
return true return false
} }
// all non miner tx must be non-coinbase tx // all non miner tx must be non-coinbase tx
@ -137,8 +137,17 @@ func (chain *Blockchain) Verify_Transaction_NonCoinbase(hf_version int64, tx *tr
return false return false
} }
tx_hash = tx.GetHash()
if tx.TransactionType == transaction.REGISTRATION { if tx.TransactionType == transaction.REGISTRATION {
if _, ok := transaction_valid_cache.Load(tx_hash); ok {
return true //logger.Infof("Found in cache %s ",tx_hash)
} else {
//logger.Infof("TX not found in cache %s len %d ",tx_hash, len(tmp_buffer))
}
if tx.IsRegistrationValid() { if tx.IsRegistrationValid() {
transaction_valid_cache.Store(tx_hash, time.Now()) // signature got verified, cache it
return true return true
} }
return false return false
@ -230,6 +239,12 @@ func (chain *Blockchain) Verify_Transaction_NonCoinbase(hf_version int64, tx *tr
panic("mentioned balance tree not found, cannot verify TX") panic("mentioned balance tree not found, cannot verify TX")
} }
if _, ok := transaction_valid_cache.Load(tx_hash); ok {
return true //logger.Infof("Found in cache %s ",tx_hash)
} else {
//logger.Infof("TX not found in cache %s len %d ",tx_hash, len(tmp_buffer))
}
//logger.Infof("dTX state tree has been found") //logger.Infof("dTX state tree has been found")
// now lets calculate CLn and CRn // now lets calculate CLn and CRn
@ -251,6 +266,7 @@ func (chain *Blockchain) Verify_Transaction_NonCoinbase(hf_version int64, tx *tr
if tx.Proof.Verify(&tx.Statement, tx.GetHash()) { if tx.Proof.Verify(&tx.Statement, tx.GetHash()) {
//logger.Infof("dTX verified with proof successfuly") //logger.Infof("dTX verified with proof successfuly")
transaction_valid_cache.Store(tx_hash, time.Now()) // signature got verified, cache it
return true return true
} }
logger.Infof("transaction verification failed\n") logger.Infof("transaction verification failed\n")

View File

@ -20,4 +20,4 @@ import "github.com/blang/semver"
// right now it has to be manually changed // right now it has to be manually changed
// do we need to include git commitsha?? // do we need to include git commitsha??
var Version = semver.MustParse("3.0.0-24.DEROHE.alpha+30122020") var Version = semver.MustParse("3.0.0-25.DEROHE.alpha+30122020")