Commit 2da367a2 authored by Ethan Buchman's avatar Ethan Buchman

fix unchecked slice index on tx.From()

parent 48083608
......@@ -109,8 +109,13 @@ func (self *TxPool) Add(tx *types.Transaction) error {
} else {
to = "[NEW_CONTRACT]"
}
txplogger.Debugf("(t) %x => %s (%v) %x\n", tx.From()[:4], to, tx.Value, tx.Hash())
var from string
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
go self.eventMux.Post(TxPreEvent{tx})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment