From 1337a8dfb11160d67db410b71af92a02d6b232f5 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 28 Jan 2015 21:34:08 +0100 Subject: upped pv --- eth/protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eth/protocol.go') diff --git a/eth/protocol.go b/eth/protocol.go index 24a0f0a8e..68c52b7ce 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -13,7 +13,7 @@ import ( ) const ( - ProtocolVersion = 51 + ProtocolVersion = 52 NetworkId = 0 ProtocolLength = uint64(8) ProtocolMaxMsgSize = 10 * 1024 * 1024 -- cgit v1.2.3 From 1d519854e2bfe8d5f2e8674f4f04ccf9aeaabe84 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 4 Feb 2015 17:28:54 -0800 Subject: Propagate known transactions to new peers on connect --- eth/protocol.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'eth/protocol.go') diff --git a/eth/protocol.go b/eth/protocol.go index 68c52b7ce..d7a7fa910 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -46,6 +46,7 @@ type ethProtocol struct { // used as an argument to EthProtocol type txPool interface { AddTransactions([]*types.Transaction) + GetTransactions() types.Transactions } type chainManager interface { @@ -101,6 +102,7 @@ func runEthProtocol(txPool txPool, chainManager chainManager, blockPool blockPoo } err = self.handleStatus() if err == nil { + self.propagateTxs() for { err = self.handle() if err != nil { @@ -324,3 +326,13 @@ func (self *ethProtocol) protoErrorDisconnect(code int, format string, params .. } } + +func (self *ethProtocol) propagateTxs() { + transactions := self.txPool.GetTransactions() + iface := make([]interface{}, len(transactions)) + for i, transaction := range transactions { + iface[i] = transaction + } + + self.rw.WriteMsg(p2p.NewMsg(TxMsg, iface...)) +} -- cgit v1.2.3