diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-06 19:41:07 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-06 19:41:07 -0700 |
| commit | d4c152a4dba0eec7c8ecd13732900909f51b1c97 (patch) | |
| tree | cf1653bad283565ad3fe3f63c763e700f04ee363 /hotline/transaction.go | |
| parent | c26c20e3539233a6cde9e64aa9d9a89b2017a772 (diff) | |
Refactor and cleanup to improve testability
Diffstat (limited to 'hotline/transaction.go')
| -rw-r--r-- | hotline/transaction.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/hotline/transaction.go b/hotline/transaction.go index e7bfa58..9eb8794 100644 --- a/hotline/transaction.go +++ b/hotline/transaction.go @@ -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 |