aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-17 19:00:29 +0800
committerFelix Lange <fjl@twurst.com>2015-03-17 19:00:29 +0800
commit27f7aa01639696f4afa4233e0a301afafdd7b950 (patch)
tree97636653dc2d88c344f6a37ef5b4113339e434d1
parentb95387a0dc0da6198549689e6b03d21a221e813b (diff)
downloaddexon-27f7aa01639696f4afa4233e0a301afafdd7b950.tar
dexon-27f7aa01639696f4afa4233e0a301afafdd7b950.tar.gz
dexon-27f7aa01639696f4afa4233e0a301afafdd7b950.tar.bz2
dexon-27f7aa01639696f4afa4233e0a301afafdd7b950.tar.lz
dexon-27f7aa01639696f4afa4233e0a301afafdd7b950.tar.xz
dexon-27f7aa01639696f4afa4233e0a301afafdd7b950.tar.zst
dexon-27f7aa01639696f4afa4233e0a301afafdd7b950.zip
core: adapt Message for new Transaction.From signature
-rw-r--r--core/block_processor.go3
-rw-r--r--core/state_transition.go5
2 files changed, 5 insertions, 3 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index fd4009037..b12f88c47 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -81,7 +81,8 @@ func (self *BlockProcessor) ApplyTransaction(coinbase *state.StateObject, stated
_, gas, err := ApplyMessage(NewEnv(statedb, self.bc, tx, block), tx, cb)
if err != nil && (IsNonceErr(err) || state.IsGasLimitErr(err) || IsInvalidTxErr(err)) {
// 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
}
diff --git a/core/state_transition.go b/core/state_transition.go
index 575bdf026..ef822e86c 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -44,9 +44,10 @@ type StateTransition struct {
env vm.Environment
}
+// Message represents a message sent to a contract.
type Message interface {
- From() common.Address
- To() common.Address
+ From() (common.Address, error)
+ To() *common.Address
GasPrice() *big.Int
Gas() *big.Int