mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-11 15:34:26 +00:00
Updated changes in genesis
This commit is contained in:
parent
26affd91ab
commit
26cafb46ea
4 changed files with 3 additions and 45 deletions
0
core/genesis_alloc.go
Normal file → Executable file
0
core/genesis_alloc.go
Normal file → Executable file
|
|
@ -357,14 +357,6 @@ func (self *StateDB) deleteStateObject(stateObject *stateObject) {
|
||||||
self.setError(self.trie.TryDelete(addr[:]))
|
self.setError(self.trie.TryDelete(addr[:]))
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteAddress removes the address from the state trie.
|
|
||||||
func (self *StateDB) DeleteAddress(addr common.Address) {
|
|
||||||
stateObject := self.getStateObject(addr)
|
|
||||||
if stateObject != nil && !stateObject.deleted {
|
|
||||||
self.deleteStateObject(stateObject)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Retrieve a state object given my the address. Returns nil if not found.
|
// Retrieve a state object given my the address. Returns nil if not found.
|
||||||
func (self *StateDB) getStateObject(addr common.Address) (stateObject *stateObject) {
|
func (self *StateDB) getStateObject(addr common.Address) (stateObject *stateObject) {
|
||||||
// Prefer 'live' objects.
|
// Prefer 'live' objects.
|
||||||
|
|
|
||||||
|
|
@ -81,11 +81,7 @@ var (
|
||||||
|
|
||||||
ErrZeroGasPrice = errors.New("zero gas price")
|
ErrZeroGasPrice = errors.New("zero gas price")
|
||||||
|
|
||||||
ErrUnderMinGasPrice = errors.New("under min gas price")
|
|
||||||
|
|
||||||
ErrDuplicateSpecialTransaction = errors.New("duplicate a special transaction")
|
ErrDuplicateSpecialTransaction = errors.New("duplicate a special transaction")
|
||||||
|
|
||||||
ErrMinDeploySMC = errors.New("smart contract creation cost is under allowance")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -591,7 +587,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
||||||
}
|
}
|
||||||
// Drop non-local transactions under our own minimal accepted gas price
|
// Drop non-local transactions under our own minimal accepted gas price
|
||||||
local = local || pool.locals.contains(from) // account may be local even if the transaction arrived from the network
|
local = local || pool.locals.contains(from) // account may be local even if the transaction arrived from the network
|
||||||
if !local && pool.gasPrice.Cmp(tx.GasPrice()) > 0 {
|
if !local && tx.To() != nil && pool.gasPrice.Cmp(tx.GasPrice()) > 0 {
|
||||||
if !tx.IsSpecialTransaction() || (pool.IsMasterNode != nil && !pool.IsMasterNode(from)) {
|
if !tx.IsSpecialTransaction() || (pool.IsMasterNode != nil && !pool.IsMasterNode(from)) {
|
||||||
return ErrUnderpriced
|
return ErrUnderpriced
|
||||||
}
|
}
|
||||||
|
|
@ -623,16 +619,6 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
||||||
if tx.GasPrice().Cmp(new(big.Int).SetInt64(0)) == 0 {
|
if tx.GasPrice().Cmp(new(big.Int).SetInt64(0)) == 0 {
|
||||||
return ErrZeroGasPrice
|
return ErrZeroGasPrice
|
||||||
}
|
}
|
||||||
|
|
||||||
// under min gas price
|
|
||||||
if tx.GasPrice().Cmp(new(big.Int).SetInt64(common.MinGasPrice)) < 0 {
|
|
||||||
return ErrUnderMinGasPrice
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
minGasDeploySMC := new(big.Int).Mul(new(big.Int).SetUint64(10), new(big.Int).SetUint64(params.Ether))
|
|
||||||
if tx.To() == nil && (tx.Cost().Cmp(minGasDeploySMC) < 0 || tx.GasPrice().Cmp(new(big.Int).SetUint64(10000*params.Shannon)) < 0) {
|
|
||||||
return ErrMinDeploySMC
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -195,19 +195,6 @@ func (tx *Transaction) To() *common.Address {
|
||||||
return &to
|
return &to
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tx *Transaction) From() *common.Address {
|
|
||||||
if tx.data.V != nil {
|
|
||||||
signer := deriveSigner(tx.data.V)
|
|
||||||
if f, err := Sender(signer, tx); err != nil {
|
|
||||||
return nil
|
|
||||||
} else {
|
|
||||||
return &f
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hash hashes the RLP encoding of tx.
|
// Hash hashes the RLP encoding of tx.
|
||||||
// It uniquely identifies the transaction.
|
// It uniquely identifies the transaction.
|
||||||
func (tx *Transaction) Hash() common.Hash {
|
func (tx *Transaction) Hash() common.Hash {
|
||||||
|
|
@ -287,13 +274,6 @@ func (tx *Transaction) IsSpecialTransaction() bool {
|
||||||
return tx.To().String() == common.RandomizeSMC || tx.To().String() == common.BlockSigners
|
return tx.To().String() == common.RandomizeSMC || tx.To().String() == common.BlockSigners
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tx *Transaction) IsSigningTransaction() bool {
|
|
||||||
if tx.To() == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return tx.To().String() == common.BlockSigners
|
|
||||||
}
|
|
||||||
|
|
||||||
func (tx *Transaction) String() string {
|
func (tx *Transaction) String() string {
|
||||||
var from, to string
|
var from, to string
|
||||||
if tx.data.V != nil {
|
if tx.data.V != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue