aboutsummaryrefslogtreecommitdiffstats
path: root/lds/txrelay.go
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-05-06 14:59:06 +0800
committerSonic <sonic@dexon.org>2019-05-06 14:59:06 +0800
commitb4720965641332435d13cc3d3f54d3c17e7ed4e7 (patch)
tree9f60c7289aa4e944c177923451c64b7dc8ed3e1f /lds/txrelay.go
parenta09d947763d043c8672233b67afb283253e68b3c (diff)
downloaddexon-b4720965641332435d13cc3d3f54d3c17e7ed4e7.tar
dexon-b4720965641332435d13cc3d3f54d3c17e7ed4e7.tar.gz
dexon-b4720965641332435d13cc3d3f54d3c17e7ed4e7.tar.bz2
dexon-b4720965641332435d13cc3d3f54d3c17e7ed4e7.tar.lz
dexon-b4720965641332435d13cc3d3f54d3c17e7ed4e7.tar.xz
dexon-b4720965641332435d13cc3d3f54d3c17e7ed4e7.tar.zst
dexon-b4720965641332435d13cc3d3f54d3c17e7ed4e7.zip
lds: rename LesTxRelay to LdsTxRelay
Diffstat (limited to 'lds/txrelay.go')
-rw-r--r--lds/txrelay.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/lds/txrelay.go b/lds/txrelay.go
index d1fe80dc8..20d137850 100644
--- a/lds/txrelay.go
+++ b/lds/txrelay.go
@@ -28,7 +28,7 @@ type ltrInfo struct {
sentTo map[*peer]struct{}
}
-type LesTxRelay struct {
+type LdsTxRelay struct {
txSent map[common.Hash]*ltrInfo
txPending map[common.Hash]struct{}
ps *peerSet
@@ -39,8 +39,8 @@ type LesTxRelay struct {
reqDist *requestDistributor
}
-func NewLesTxRelay(ps *peerSet, reqDist *requestDistributor) *LesTxRelay {
- r := &LesTxRelay{
+func NewLesTxRelay(ps *peerSet, reqDist *requestDistributor) *LdsTxRelay {
+ r := &LdsTxRelay{
txSent: make(map[common.Hash]*ltrInfo),
txPending: make(map[common.Hash]struct{}),
ps: ps,
@@ -50,14 +50,14 @@ func NewLesTxRelay(ps *peerSet, reqDist *requestDistributor) *LesTxRelay {
return r
}
-func (self *LesTxRelay) registerPeer(p *peer) {
+func (self *LdsTxRelay) registerPeer(p *peer) {
self.lock.Lock()
defer self.lock.Unlock()
self.peerList = self.ps.AllPeers()
}
-func (self *LesTxRelay) unregisterPeer(p *peer) {
+func (self *LdsTxRelay) unregisterPeer(p *peer) {
self.lock.Lock()
defer self.lock.Unlock()
@@ -66,7 +66,7 @@ func (self *LesTxRelay) unregisterPeer(p *peer) {
// send sends a list of transactions to at most a given number of peers at
// once, never resending any particular transaction to the same peer twice
-func (self *LesTxRelay) send(txs types.Transactions, count int) {
+func (self *LdsTxRelay) send(txs types.Transactions, count int) {
sendTo := make(map[*peer]types.Transactions)
self.peerStartPos++ // rotate the starting position of the peer list
@@ -134,14 +134,14 @@ func (self *LesTxRelay) send(txs types.Transactions, count int) {
}
}
-func (self *LesTxRelay) Send(txs types.Transactions) {
+func (self *LdsTxRelay) Send(txs types.Transactions) {
self.lock.Lock()
defer self.lock.Unlock()
self.send(txs, 3)
}
-func (self *LesTxRelay) NewHead(head common.Hash, mined []common.Hash, rollback []common.Hash) {
+func (self *LdsTxRelay) NewHead(head common.Hash, mined []common.Hash, rollback []common.Hash) {
self.lock.Lock()
defer self.lock.Unlock()
@@ -164,7 +164,7 @@ func (self *LesTxRelay) NewHead(head common.Hash, mined []common.Hash, rollback
}
}
-func (self *LesTxRelay) Discard(hashes []common.Hash) {
+func (self *LdsTxRelay) Discard(hashes []common.Hash) {
self.lock.Lock()
defer self.lock.Unlock()