mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Merge branch 'ethdbGolint2' of https://github.com/kielbarry/go-ethereum into ethdbGolint2
This commit is contained in:
commit
185fd12871
3 changed files with 10 additions and 9 deletions
|
|
@ -99,7 +99,7 @@ func (it *instructionIterator) Arg() []byte {
|
|||
return it.arg
|
||||
}
|
||||
|
||||
// Pretty-print all disassembled EVM instructions to stdout.
|
||||
// PrintDisassembled pretty-print all disassembled EVM instructions to stdout.
|
||||
func PrintDisassembled(code string) error {
|
||||
script, err := hex.DecodeString(code)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ func NewMemDatabaseWithCap(size int) *MemDatabase {
|
|||
db: make(map[string][]byte, size),
|
||||
}
|
||||
}
|
||||
|
||||
// Put sets the value of the key.
|
||||
func (db *MemDatabase) Put(key []byte, value []byte) error {
|
||||
db.lock.Lock()
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ type Generic struct {
|
|||
Fn func(data interface{})
|
||||
}
|
||||
|
||||
// self = registered, f = incoming
|
||||
func (self Generic) Compare(f Filter) bool {
|
||||
// g = registered, f = incoming
|
||||
func (g Generic) Compare(f Filter) bool {
|
||||
var strMatch, dataMatch = true, true
|
||||
|
||||
filter := f.(Generic)
|
||||
if (len(self.Str1) > 0 && filter.Str1 != self.Str1) ||
|
||||
(len(self.Str2) > 0 && filter.Str2 != self.Str2) ||
|
||||
(len(self.Str3) > 0 && filter.Str3 != self.Str3) {
|
||||
if (len(g.Str1) > 0 && filter.Str1 != g.Str1) ||
|
||||
(len(g.Str2) > 0 && filter.Str2 != g.Str2) ||
|
||||
(len(g.Str3) > 0 && filter.Str3 != g.Str3) {
|
||||
strMatch = false
|
||||
}
|
||||
|
||||
for k := range self.Data {
|
||||
for k := range g.Data {
|
||||
if _, ok := filter.Data[k]; !ok {
|
||||
return false
|
||||
}
|
||||
|
|
@ -43,6 +43,6 @@ func (self Generic) Compare(f Filter) bool {
|
|||
return strMatch && dataMatch
|
||||
}
|
||||
|
||||
func (self Generic) Trigger(data interface{}) {
|
||||
self.Fn(data)
|
||||
func (g Generic) Trigger(data interface{}) {
|
||||
g.Fn(data)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue