Skip to content

Commit

Permalink
wire/msgtx: remove unused read/writeOutPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
cfromknecht committed Jan 25, 2020
1 parent 73f0133 commit c327fba
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
34 changes: 0 additions & 34 deletions wire/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,26 +365,6 @@ func BenchmarkWriteVarStrBuf10(b *testing.B) {
func BenchmarkReadOutPoint(b *testing.B) {
b.ReportAllocs()

buf := []byte{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Previous output hash
0xff, 0xff, 0xff, 0xff, // Previous output index
}
r := bytes.NewReader(buf)
var op OutPoint
for i := 0; i < b.N; i++ {
r.Seek(0, 0)
readOutPoint(r, 0, 0, &op)
}
}

// BenchmarkReadOutPointBuf performs a benchmark on how long it takes to read a
// transaction output point.
func BenchmarkReadOutPointBuf(b *testing.B) {
b.ReportAllocs()

buffer := binarySerializer.Borrow()
buf := []byte{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand All @@ -407,20 +387,6 @@ func BenchmarkReadOutPointBuf(b *testing.B) {
func BenchmarkWriteOutPoint(b *testing.B) {
b.ReportAllocs()

op := &OutPoint{
Hash: chainhash.Hash{},
Index: 0,
}
for i := 0; i < b.N; i++ {
writeOutPoint(ioutil.Discard, 0, 0, op)
}
}

// BenchmarkWriteOutPointBuf performs a benchmark on how long it takes to write a
// transaction output point.
func BenchmarkWriteOutPointBuf(b *testing.B) {
b.ReportAllocs()

buf := binarySerializer.Borrow()
op := &OutPoint{
Hash: chainhash.Hash{},
Expand Down
21 changes: 0 additions & 21 deletions wire/msgtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,16 +916,6 @@ func NewMsgTx(version int32) *MsgTx {
}
}

// readOutPoint reads the next sequence of bytes from r as an OutPoint.
//
// DEPRECATED: Use readOutPointBuf instead.
func readOutPoint(r io.Reader, pver uint32, version int32, op *OutPoint) error {
buf := binarySerializer.Borrow()
err := readOutPointBuf(r, pver, version, op, buf)
binarySerializer.Return(buf)
return err
}

// readOutPointBuf reads the next sequence of bytes from r as an OutPoint.
//
// If b is non-nil, the provided buffer will be used for serializing small
Expand All @@ -949,17 +939,6 @@ func readOutPointBuf(r io.Reader, pver uint32, version int32, op *OutPoint,
return nil
}

// writeOutPoint encodes op to the bitcoin protocol encoding for an OutPoint
// to w.
//
// DEPRECATED: Use writeOutPointBuf instead.
func writeOutPoint(w io.Writer, pver uint32, version int32, op *OutPoint) error {
buf := binarySerializer.Borrow()
err := writeOutPointBuf(w, pver, version, op, buf)
binarySerializer.Return(buf)
return err
}

// writeOutPoint encodes op to the bitcoin protocol encoding for an OutPoint
// to w.
//
Expand Down

0 comments on commit c327fba

Please sign in to comment.