mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
core/vm: fixed printable characters using unicode instead
This commit is contained in:
parent
e2c2d8e15e
commit
02d629af8f
@ -71,14 +71,10 @@ func (sm *BlockProcessor) TransitionState(statedb *state.StateDB, parent, block
|
|||||||
|
|
||||||
func (self *BlockProcessor) ApplyTransaction(coinbase *state.StateObject, statedb *state.StateDB, block *types.Block, tx *types.Transaction, usedGas *big.Int, transientProcess bool) (*types.Receipt, *big.Int, error) {
|
func (self *BlockProcessor) ApplyTransaction(coinbase *state.StateObject, statedb *state.StateDB, block *types.Block, tx *types.Transaction, usedGas *big.Int, transientProcess bool) (*types.Receipt, *big.Int, error) {
|
||||||
// If we are mining this block and validating we want to set the logs back to 0
|
// If we are mining this block and validating we want to set the logs back to 0
|
||||||
//statedb.EmptyLogs()
|
|
||||||
|
|
||||||
cb := statedb.GetStateObject(coinbase.Address())
|
cb := statedb.GetStateObject(coinbase.Address())
|
||||||
_, gas, err := ApplyMessage(NewEnv(statedb, self.bc, tx, block), tx, cb)
|
_, gas, err := ApplyMessage(NewEnv(statedb, self.bc, tx, block), tx, cb)
|
||||||
if err != nil && (IsNonceErr(err) || state.IsGasLimitErr(err) || IsInvalidTxErr(err)) {
|
if err != nil && (IsNonceErr(err) || state.IsGasLimitErr(err) || IsInvalidTxErr(err)) {
|
||||||
// If the account is managed, remove the invalid nonce.
|
|
||||||
//from, _ := tx.From()
|
|
||||||
//self.bc.TxState().RemoveNonce(from, tx.Nonce())
|
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package vm
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"unicode/utf8"
|
"unicode"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
)
|
)
|
||||||
@ -27,7 +27,7 @@ func StdErrFormat(logs []StructLog) {
|
|||||||
for _, r := range data {
|
for _, r := range data {
|
||||||
if r == 0 {
|
if r == 0 {
|
||||||
str += "."
|
str += "."
|
||||||
} else if utf8.ValidRune(rune(r)) {
|
} else if unicode.IsPrint(rune(r)) {
|
||||||
str += fmt.Sprintf("%s", string(r))
|
str += fmt.Sprintf("%s", string(r))
|
||||||
} else {
|
} else {
|
||||||
str += "?"
|
str += "?"
|
||||||
|
Loading…
Reference in New Issue
Block a user