From e31ec57f8875147766b2bf8e6f129b9a0c1b5e69 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Mon, 2 Mar 2015 08:17:09 -0600 Subject: Add event eth.tx.received --- eth/protocol.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'eth') diff --git a/eth/protocol.go b/eth/protocol.go index 8221c1b29..a5cc8ee1a 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethutil" + "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" ) @@ -137,6 +138,12 @@ func (self *ethProtocol) handle() error { if err := msg.Decode(&txs); err != nil { return self.protoError(ErrDecode, "msg %v: %v", msg, err) } + for _, tx := range txs { + jsonlogger.LogJson(&logger.EthTxReceived{ + TxHash: ethutil.Bytes2Hex(tx.Hash()), + RemoteId: self.peer.ID().String(), + }) + } self.txPool.AddTransactions(txs) case GetBlockHashesMsg: -- cgit