aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-08 23:14:58 +0800
committerobscuren <geffobscura@gmail.com>2015-04-08 23:15:45 +0800
commit1c872ddf4b1db51847a5d9d020e13d432e847f52 (patch)
tree72ec461427269a25165b58043f328fd374e143ee /core/types
parent6284604b52e075e454e61f2933cadaaf9ded364b (diff)
downloaddexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar
dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar.gz
dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar.bz2
dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar.lz
dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar.xz
dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.tar.zst
dexon-1c872ddf4b1db51847a5d9d020e13d432e847f52.zip
Changed how logs are being recorded
Logs are now recorded per transactions instead of tossing them out after each transaction. This should also fix an issue with `eth_getFilterLogs` (#629) Also now implemented are the `transactionHash, blockHash, transactionIndex, logIndex` on logs. Closes #654.
Diffstat (limited to 'core/types')
-rw-r--r--core/types/bloom9.go8
-rw-r--r--core/types/receipt.go19
2 files changed, 5 insertions, 22 deletions
diff --git a/core/types/bloom9.go b/core/types/bloom9.go
index af90679ce..0d37cb19f 100644
--- a/core/types/bloom9.go
+++ b/core/types/bloom9.go
@@ -4,8 +4,8 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/core/state"
+ "github.com/ethereum/go-ethereum/crypto"
)
func CreateBloom(receipts Receipts) Bloom {
@@ -20,10 +20,10 @@ func CreateBloom(receipts Receipts) Bloom {
func LogsBloom(logs state.Logs) *big.Int {
bin := new(big.Int)
for _, log := range logs {
- data := make([]common.Hash, len(log.Topics()))
- bin.Or(bin, bloom9(log.Address().Bytes()))
+ data := make([]common.Hash, len(log.Topics))
+ bin.Or(bin, bloom9(log.Address.Bytes()))
- for i, topic := range log.Topics() {
+ for i, topic := range log.Topics {
data[i] = topic
}
diff --git a/core/types/receipt.go b/core/types/receipt.go
index 83c981f93..414e4d364 100644
--- a/core/types/receipt.go
+++ b/core/types/receipt.go
@@ -7,8 +7,8 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/core/state"
+ "github.com/ethereum/go-ethereum/rlp"
)
type Receipt struct {
@@ -30,12 +30,6 @@ func (self *Receipt) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, []interface{}{self.PostState, self.CumulativeGasUsed, self.Bloom, self.logs})
}
-/*
-func (self *Receipt) RlpData() interface{} {
- return []interface{}{self.PostState, self.CumulativeGasUsed, self.Bloom, self.logs.RlpData()}
-}
-*/
-
func (self *Receipt) RlpEncode() []byte {
bytes, err := rlp.EncodeToBytes(self)
if err != nil {
@@ -58,17 +52,6 @@ func (self *Receipt) String() string {
type Receipts []*Receipt
-/*
-func (self Receipts) RlpData() interface{} {
- data := make([]interface{}, len(self))
- for i, receipt := range self {
- data[i] = receipt.RlpData()
- }
-
- return data
-}
-*/
-
func (self Receipts) RlpEncode() []byte {
bytes, err := rlp.EncodeToBytes(self)
if err != nil {