Skip to content

Commit 1495848

Browse files
authored
fix(protocol): preallocate return struct (#914)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent e28e9be commit 1495848

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

protocol/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727
AgencyServer ProtocolStateAgency = 2 // Server agency
2828
)
2929

30-
// State represents protocol state with both a numeric ID and a string identifer
30+
// State represents protocol state with both a numeric ID and a string identifier
3131
type State struct {
3232
Id uint
3333
Name string

protocol/txsubmission/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (s *Server) RequestTxIds(
122122

123123
// RequestTxs requests the content of the requested TX identifiers from the remote node's mempool
124124
func (s *Server) RequestTxs(txIds []TxId) ([]TxBody, error) {
125-
var txString []string
125+
txString := []string{}
126126
for _, t := range txIds {
127127
ba := []byte{}
128128
for _, b := range t.TxId {

0 commit comments

Comments
 (0)