mirror of
https://github.com/btcsuite/btcd.git
synced 2025-03-11 17:57:50 +01:00
wire: export WriteOutPoint to public module
This commit is contained in:
parent
cfe801fe2e
commit
81a546bded
2 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue