fix unchecked slice index on tx.From()
This commit is contained in:
parent
48083608b5
commit
2da367a2be
|
@ -109,8 +109,13 @@ func (self *TxPool) Add(tx *types.Transaction) error {
|
||||||
} else {
|
} else {
|
||||||
to = "[NEW_CONTRACT]"
|
to = "[NEW_CONTRACT]"
|
||||||
}
|
}
|
||||||
|
var from string
|
||||||
txplogger.Debugf("(t) %x => %s (%v) %x\n", tx.From()[:4], to, tx.Value, tx.Hash())
|
if len(tx.From()) > 0 {
|
||||||
|
from = ethutil.Bytes2Hex(tx.From()[:4])
|
||||||
|
} else {
|
||||||
|
from = "INVALID"
|
||||||
|
}
|
||||||
|
txplogger.Debugf("(t) %x => %s (%v) %x\n", from, to, tx.Value, tx.Hash())
|
||||||
|
|
||||||
// Notify the subscribers
|
// Notify the subscribers
|
||||||
go self.eventMux.Post(TxPreEvent{tx})
|
go self.eventMux.Post(TxPreEvent{tx})
|
||||||
|
|
Loading…
Reference in New Issue