aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2016-01-20 06:50:00 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2016-02-18 17:11:48 +0800
commitb6d88a0e9f9aaeb47d585d79c768d457b545af90 (patch)
tree49e667cd929ce6b561961ac741d9ff0f82e61261 /core/types
parent4f4d2b647488eaa056613fa6f026229ac91f066a (diff)
downloaddexon-b6d88a0e9f9aaeb47d585d79c768d457b545af90.tar
dexon-b6d88a0e9f9aaeb47d585d79c768d457b545af90.tar.gz
dexon-b6d88a0e9f9aaeb47d585d79c768d457b545af90.tar.bz2
dexon-b6d88a0e9f9aaeb47d585d79c768d457b545af90.tar.lz
dexon-b6d88a0e9f9aaeb47d585d79c768d457b545af90.tar.xz
dexon-b6d88a0e9f9aaeb47d585d79c768d457b545af90.tar.zst
dexon-b6d88a0e9f9aaeb47d585d79c768d457b545af90.zip
core, core/vm, crypto: fixes for homestead
* Removed some strange code that didn't apply state reverting properly * Refactored code setting from vm & state transition to the executioner * Updated tests
Diffstat (limited to 'core/types')
-rw-r--r--core/types/transaction.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go
index af952e450..0c9c1ce18 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -157,7 +157,14 @@ func (tx *Transaction) Size() common.StorageSize {
return common.StorageSize(c)
}
-// From() caches the address, allowing it to be used regardless of
+// From returns the address derived from the signature (V, R, S) using secp256k1
+// eliptic curve and an error if it failed deriving or upon an incorrect
+// signature.
+//
+// From Uses the homestead consensus rules to determine whether the signature is
+// valid.
+//
+// From caches the address, allowing it to be used regardless of
// Frontier / Homestead. however, the first time called it runs
// signature validations, so we need two versions. This makes it
// easier to ensure backwards compatibility of things like package rpc
@@ -168,6 +175,20 @@ func (tx *Transaction) From() (common.Address, error) {
return doFrom(tx, true)
}
+// FromFrontier returns the address derived from the signature (V, R, S) using
+// secp256k1 eliptic curve and an error if it failed deriving or upon an
+// incorrect signature.
+//
+// FromFrantier uses the frontier consensus rules to determine whether the
+// signature is valid.
+//
+// FromFrontier caches the address, allowing it to be used regardless of
+// Frontier / Homestead. however, the first time called it runs
+// signature validations, so we need two versions. This makes it
+// easier to ensure backwards compatibility of things like package rpc
+// where eth_getblockbynumber uses tx.From() and needs to work for
+// both txs before and after the first homestead block. Signatures
+// valid in homestead are a subset of valid ones in Frontier)
func (tx *Transaction) FromFrontier() (common.Address, error) {
return doFrom(tx, false)
}