core: adapt Message for new Transaction.From signature

This commit is contained in:
Felix Lange 2015-03-17 12:00:29 +01:00
parent b95387a0dc
commit 27f7aa0163
2 changed files with 5 additions and 3 deletions

View File

@ -81,7 +81,8 @@ func (self *BlockProcessor) ApplyTransaction(coinbase *state.StateObject, stated
_, 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. // If the account is managed, remove the invalid nonce.
self.bc.TxState().RemoveNonce(tx.From(), tx.Nonce()) from, _ := tx.From()
self.bc.TxState().RemoveNonce(from, tx.Nonce())
return nil, nil, err return nil, nil, err
} }

View File

@ -44,9 +44,10 @@ type StateTransition struct {
env vm.Environment env vm.Environment
} }
// Message represents a message sent to a contract.
type Message interface { type Message interface {
From() common.Address From() (common.Address, error)
To() common.Address To() *common.Address
GasPrice() *big.Int GasPrice() *big.Int
Gas() *big.Int Gas() *big.Int