diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-28 22:35:07 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-28 22:35:07 +0800 |
commit | 03178a77b66b55c26b966dab5069847b1d139054 (patch) | |
tree | f5552fae68535f2308bef2e01053bfaabd52d078 /core/state | |
parent | 4baa5ca963552df6ed11112094f08111c8cf14bd (diff) | |
parent | e3253b5d5e65bfb6944ddaabd3c79400fbe06ef8 (diff) | |
download | dexon-03178a77b66b55c26b966dab5069847b1d139054.tar dexon-03178a77b66b55c26b966dab5069847b1d139054.tar.gz dexon-03178a77b66b55c26b966dab5069847b1d139054.tar.bz2 dexon-03178a77b66b55c26b966dab5069847b1d139054.tar.lz dexon-03178a77b66b55c26b966dab5069847b1d139054.tar.xz dexon-03178a77b66b55c26b966dab5069847b1d139054.tar.zst dexon-03178a77b66b55c26b966dab5069847b1d139054.zip |
Merge pull request #1132 from obscuren/log_optimisations
core: log optimisations
Diffstat (limited to 'core/state')
-rw-r--r-- | core/state/log.go | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/core/state/log.go b/core/state/log.go index a7aa784e2..882977061 100644 --- a/core/state/log.go +++ b/core/state/log.go @@ -29,15 +29,22 @@ func (self *Log) EncodeRLP(w io.Writer) error { } func (self *Log) String() string { - return fmt.Sprintf(`log: %x %x %x`, self.Address, self.Topics, self.Data) + return fmt.Sprintf(`log: %x %x %x %x %d %x %d`, self.Address, self.Topics, self.Data, self.TxHash, self.TxIndex, self.BlockHash, self.Index) } type Logs []*Log -func (self Logs) String() (ret string) { - for _, log := range self { - ret += fmt.Sprintf("%v", log) - } - - return "[" + ret + "]" +type LogForStorage Log + +func (self *LogForStorage) EncodeRLP(w io.Writer) error { + return rlp.Encode(w, []interface{}{ + self.Address, + self.Topics, + self.Data, + self.Number, + self.TxHash, + self.TxIndex, + self.BlockHash, + self.Index, + }) } |