From 235a636af2ca57d03318acb32aa7875ca6ae66fb Mon Sep 17 00:00:00 2001 From: William Banfield Date: Mon, 14 Mar 2022 17:47:09 -0400 Subject: [PATCH] comment Txs sort --- types/tx.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/tx.go b/types/tx.go index e7a39bc88..c4aae1cbc 100644 --- a/types/tx.go +++ b/types/tx.go @@ -63,6 +63,8 @@ func (txs Txs) IndexByHash(hash []byte) int { return -1 } +// Txs is a slice of transactions. Sorting a Txs value orders the transactions +// lexicographically. func (txs Txs) Len() int { return len(txs) } func (txs Txs) Swap(i, j int) { txs[i], txs[j] = txs[j], txs[i] } func (txs Txs) Less(i, j int) bool {