diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-28 22:19:31 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-28 22:19:31 +0800 |
commit | 95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a (patch) | |
tree | e1a297edd5d71d5b0dca94f828467c585ca511e1 /ethchain/transaction.go | |
parent | 818cbcbdd41854eff7b4943039e10c1e609b240d (diff) | |
parent | 76a59274bfce73ec988131804c643be743d2b4d2 (diff) | |
download | dexon-95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a.tar dexon-95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a.tar.gz dexon-95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a.tar.bz2 dexon-95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a.tar.lz dexon-95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a.tar.xz dexon-95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a.tar.zst dexon-95adac7522d6041a2d6bf7b2c6b1fd311c4e6e2a.zip |
Merge branch 'release/poc5-rc11'
Diffstat (limited to 'ethchain/transaction.go')
-rw-r--r-- | ethchain/transaction.go | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go index 2c5615f99..2cb946b3b 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -147,22 +147,6 @@ func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value) { if len(tx.Recipient) == 0 { tx.contractCreation = true } - - /* - // If the list is of length 10 it's a contract creation tx - if decoder.Len() == 10 { - tx.contractCreation = true - tx.Init = decoder.Get(6).Bytes() - - tx.v = byte(decoder.Get(7).Uint()) - tx.r = decoder.Get(8).Bytes() - tx.s = decoder.Get(9).Bytes() - } else { - tx.v = byte(decoder.Get(6).Uint()) - tx.r = decoder.Get(7).Bytes() - tx.s = decoder.Get(8).Bytes() - } - */ } func (tx *Transaction) String() string { @@ -228,3 +212,15 @@ func (self *Receipt) String() string { self.PostState, self.CumulativeGasUsed) } + +// Transaction slice type for basic sorting +type Transactions []*Transaction + +func (s Transactions) Len() int { return len(s) } +func (s Transactions) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +type TxByNonce struct{ Transactions } + +func (s TxByNonce) Less(i, j int) bool { + return s.Transactions[i].Nonce < s.Transactions[j].Nonce +} |