wire: export WriteOutPoint to public module

This commit is contained in:
Olaoluwa Osuntokun 2022-01-06 17:30:28 -08:00
parent cfe801fe2e
commit 81a546bded
No known key found for this signature in database
GPG key ID: 3BBD59E99B280306
2 changed files with 4 additions and 4 deletions

View file

@ -200,7 +200,7 @@ func BenchmarkWriteOutPoint(b *testing.B) {
Index: 0,
}
for i := 0; i < b.N; i++ {
writeOutPoint(ioutil.Discard, 0, 0, op)
WriteOutPoint(ioutil.Discard, 0, 0, op)
}
}

View file

@ -930,9 +930,9 @@ func readOutPoint(r io.Reader, pver uint32, version int32, op *OutPoint) error {
return err
}
// writeOutPoint encodes op to the bitcoin protocol encoding for an OutPoint
// WriteOutPoint encodes op to the bitcoin protocol encoding for an OutPoint
// to w.
func writeOutPoint(w io.Writer, pver uint32, version int32, op *OutPoint) error {
func WriteOutPoint(w io.Writer, pver uint32, version int32, op *OutPoint) error {
_, err := w.Write(op.Hash[:])
if err != nil {
return err
@ -992,7 +992,7 @@ func readTxIn(r io.Reader, pver uint32, version int32, ti *TxIn) error {
// writeTxIn encodes ti to the bitcoin protocol encoding for a transaction
// input (TxIn) to w.
func writeTxIn(w io.Writer, pver uint32, version int32, ti *TxIn) error {
err := writeOutPoint(w, pver, version, &ti.PreviousOutPoint)
err := WriteOutPoint(w, pver, version, &ti.PreviousOutPoint)
if err != nil {
return err
}