aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-19 07:33:05 +0800
committerobscuren <geffobscura@gmail.com>2014-12-19 07:33:05 +0800
commit207b6c50fb6dcc698bac832e98b2d633f79532e4 (patch)
tree8b5e31c3b8c89565b1a6f9f4fce3da991d0f71e3 /core/types
parent6e24b1587de95b45fe0d7623528bb2f5a48e9823 (diff)
parent7c24cd790d39b67ee16ad7f1b1a805fcb131dc8a (diff)
downloaddexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar
dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar.gz
dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar.bz2
dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar.lz
dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar.xz
dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar.zst
dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.zip
Merge branch 'badsig' of https://github.com/ebuchman/go-ethereum into ebuchman-badsig
Conflicts: core/transaction_pool.go
Diffstat (limited to 'core/types')
-rw-r--r--core/types/transaction.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go
index c64fb69f0..95a256a76 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -77,7 +77,7 @@ func (self *Transaction) SetNonce(nonce uint64) {
}
func (self *Transaction) From() []byte {
- return self.Sender()
+ return self.sender()
}
func (self *Transaction) To() []byte {
@@ -114,12 +114,12 @@ func (tx *Transaction) PublicKey() []byte {
return pubkey
}
-func (tx *Transaction) Sender() []byte {
+func (tx *Transaction) sender() []byte {
pubkey := tx.PublicKey()
// Validate the returned key.
// Return nil if public key isn't in full format
- if len(pubkey) != 0 && pubkey[0] != 4 {
+ if len(pubkey) == 0 || pubkey[0] != 4 {
return nil
}
@@ -187,7 +187,7 @@ func (tx *Transaction) String() string {
`,
tx.Hash(),
len(tx.recipient) == 0,
- tx.Sender(),
+ tx.From(),
tx.recipient,
tx.nonce,
tx.gasPrice,