소스 검색

core/types: polish TxDifference code and docs a bit (#17130)

* core: fix func TxDifference

fix a typo in func comment;
change named return to unnamed as there's explicit return in the body

* fix another typo in TxDifference
Smilenator 7 년 전
부모
커밋
30bdf817a0
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      core/types/transaction.go

+ 3 - 3
core/types/transaction.go

@@ -266,9 +266,9 @@ func (s Transactions) GetRlp(i int) []byte {
 	return enc
 }
 
-// TxDifference returns a new set t which is the difference between a to b.
-func TxDifference(a, b Transactions) (keep Transactions) {
-	keep = make(Transactions, 0, len(a))
+// TxDifference returns a new set which is the difference between a and b.
+func TxDifference(a, b Transactions) Transactions {
+	keep := make(Transactions, 0, len(a))
 
 	remove := make(map[common.Hash]struct{})
 	for _, tx := range b {