TransactionHandle handles the transaction message from peer
(data *msgTypes.MsgPayload, p2p p2p.P2P, pid *evtActor.PID, args ...interface{})
| 224 | |
| 225 | // TransactionHandle handles the transaction message from peer |
| 226 | func TransactionHandle(data *msgTypes.MsgPayload, p2p p2p.P2P, pid *evtActor.PID, args ...interface{}) { |
| 227 | log.Trace("[p2p]receive transaction message", data.Addr, data.Id) |
| 228 | |
| 229 | var trn = data.Payload.(*msgTypes.Trn) |
| 230 | |
| 231 | if !txCache.Contains(trn.Txn.Hash()) { |
| 232 | txCache.Add(trn.Txn.Hash(), nil) |
| 233 | actor.AddTransaction(trn.Txn) |
| 234 | } else { |
| 235 | log.Tracef("[p2p]receive duplicate Transaction message, txHash: %x\n", trn.Txn.Hash()) |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | // VersionHandle handles version handshake protocol from peer |
| 240 | func VersionHandle(data *msgTypes.MsgPayload, p2p p2p.P2P, pid *evtActor.PID, args ...interface{}) { |