Skip to content

Commit 1b31a66

Browse files
committed
fix(): rename NewShortConn to NewTempConn
1 parent 59b5d12 commit 1b31a66

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func NewClient(nodeUrl string, proxyUrl ...string) *Client {
4444
return &Client{client: httpClient, url: nodeUrl}
4545
}
4646

47-
func NewShortConn() *Client {
47+
func NewTempConn() *Client {
4848
transport := http.Transport{DisableKeepAlives: true}
4949
cli := &http.Client{Transport: &transport}
5050
return &Client{client: cli}

client_broadcast.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func (c *Client) BroadcastData(txId string, data []byte, numOfNodes int64, peers
1616
}
1717

1818
count := int64(0)
19-
pNode := NewShortConn()
19+
pNode := NewTempConn()
2020
for _, peer := range peers {
2121
pNode.SetShortConnUrl("http://" + peer)
2222
uploader, err := CreateUploader(pNode, txId, data)
@@ -46,7 +46,7 @@ func (c *Client) GetTxDataFromPeers(txId string, peers ...string) ([]byte, error
4646
}
4747
}
4848

49-
pNode := NewShortConn()
49+
pNode := NewTempConn()
5050
for _, peer := range peers {
5151
pNode.SetShortConnUrl("http://" + peer)
5252
data, err := pNode.DownloadChunkData(txId)
@@ -69,7 +69,7 @@ func (c *Client) GetBlockFromPeers(height int64, peers ...string) (*types.Block,
6969
}
7070
}
7171

72-
pNode := NewShortConn()
72+
pNode := NewTempConn()
7373
for _, peer := range peers {
7474
pNode.SetShortConnUrl("http://" + peer)
7575
block, err := pNode.GetBlockByHeight(height)
@@ -93,7 +93,7 @@ func (c *Client) GetTxFromPeers(arId string, peers ...string) (*types.Transactio
9393
}
9494
}
9595

96-
pNode := NewShortConn()
96+
pNode := NewTempConn()
9797
for _, peer := range peers {
9898
pNode.SetShortConnUrl("http://" + peer)
9999
tx, err := pNode.GetTransactionByID(arId)
@@ -117,7 +117,7 @@ func (c *Client) GetUnconfirmedTxFromPeers(arId string, peers ...string) (*types
117117
}
118118
}
119119

120-
pNode := NewShortConn()
120+
pNode := NewTempConn()
121121
for _, peer := range peers {
122122
pNode.SetShortConnUrl("http://" + peer)
123123
tx, err := pNode.GetUnconfirmedTx(arId)

0 commit comments

Comments
 (0)