]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/transaction.go
Refactor and cleanup to improve testability
[rbdr/mobius] / hotline / transaction.go
index e7bfa58318a9f1baa4330e14ae5709ee55da3546..9eb879474e43b7e018d605350906825a482cd088 100644 (file)
@@ -6,7 +6,6 @@ import (
        "fmt"
        "github.com/jhalter/mobius/concat"
        "math/rand"
-       "net"
 )
 
 const (
@@ -131,29 +130,6 @@ func ReadTransaction(buf []byte) (*Transaction, int, error) {
        }, tranLen, nil
 }
 
-func readN(conn net.Conn, n int) ([]Transaction, error) {
-       buf := make([]byte, 1400)
-       i := 0
-       for {
-               readLen, err := conn.Read(buf)
-               if err != nil {
-                       return nil, err
-               }
-
-               transactions, _, err := readTransactions(buf[:readLen])
-               //              spew.Fdump(os.Stderr, transactions)
-               if err != nil {
-                       return nil, err
-               }
-
-               i += len(transactions)
-
-               if n == i {
-                       return transactions, nil
-               }
-       }
-}
-
 func readTransactions(buf []byte) ([]Transaction, int, error) {
        var transactions []Transaction