diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-20 09:45:05 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-20 09:45:05 +0800 |
commit | 125bdc325352823bcf83a1a671a0bfaea1d7d7ff (patch) | |
tree | b2720bfa2e26d8c39d0ef34653c7dee649c76821 /core/types | |
parent | 75f0412f9dcd883d93cbf39a90d9c434c746d19e (diff) | |
parent | 6cff6dd8b863e340851a9ec9a559881ea9520688 (diff) | |
download | dexon-125bdc325352823bcf83a1a671a0bfaea1d7d7ff.tar dexon-125bdc325352823bcf83a1a671a0bfaea1d7d7ff.tar.gz dexon-125bdc325352823bcf83a1a671a0bfaea1d7d7ff.tar.bz2 dexon-125bdc325352823bcf83a1a671a0bfaea1d7d7ff.tar.lz dexon-125bdc325352823bcf83a1a671a0bfaea1d7d7ff.tar.xz dexon-125bdc325352823bcf83a1a671a0bfaea1d7d7ff.tar.zst dexon-125bdc325352823bcf83a1a671a0bfaea1d7d7ff.zip |
Merge branch 'develop' into poc8
Conflicts:
cmd/ethereum/flags.go
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/transaction.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go index 95a256a76..3a87f7844 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -47,7 +47,7 @@ func NewTransactionFromValue(val *ethutil.Value) *Transaction { } func (tx *Transaction) Hash() []byte { - data := []interface{}{tx.Nonce, tx.gasPrice, tx.gas, tx.recipient, tx.Value, tx.Data} + data := []interface{}{tx.nonce, tx.gasPrice, tx.gas, tx.recipient, tx.value, tx.data} return crypto.Sha3(ethutil.NewValue(data).Encode()) } @@ -108,8 +108,8 @@ func (tx *Transaction) PublicKey() []byte { sig := append(r, s...) sig = append(sig, v-27) - pubkey := crypto.Ecrecover(append(hash, sig...)) - //pubkey, _ := secp256k1.RecoverPubkey(hash, sig) + //pubkey := crypto.Ecrecover(append(hash, sig...)) + pubkey, _ := secp256k1.RecoverPubkey(hash, sig) return pubkey } @@ -138,9 +138,7 @@ func (tx *Transaction) Sign(privk []byte) error { } func (tx *Transaction) RlpData() interface{} { - data := []interface{}{tx.Nonce, tx.GasPrice, tx.Gas, tx.recipient, tx.Value, tx.Data} - - // TODO Remove prefixing zero's + data := []interface{}{tx.nonce, tx.gasPrice, tx.gas, tx.recipient, tx.value, tx.data} return append(data, tx.v, new(big.Int).SetBytes(tx.r).Bytes(), new(big.Int).SetBytes(tx.s).Bytes()) } @@ -184,6 +182,7 @@ func (tx *Transaction) String() string { V: 0x%x R: 0x%x S: 0x%x + Hex: %x `, tx.Hash(), len(tx.recipient) == 0, @@ -192,11 +191,13 @@ func (tx *Transaction) String() string { tx.nonce, tx.gasPrice, tx.gas, - tx.Value, - tx.Data, + tx.value, + tx.data, tx.v, tx.r, - tx.s) + tx.s, + ethutil.Encode(tx), + ) } // Transaction slice type for basic sorting |