mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-18 22:34:22 +01:00
move basetypes into lightning
This commit is contained in:
19
lightning/outpoint.go
Normal file
19
lightning/outpoint.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package lightning
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
)
|
||||
|
||||
func NewOutPoint(fundingTxID []byte, index uint32) (*wire.OutPoint, error) {
|
||||
var h chainhash.Hash
|
||||
err := h.SetBytes(fundingTxID)
|
||||
if err != nil {
|
||||
log.Printf("h.SetBytes(%x) error: %v", fundingTxID, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return wire.NewOutPoint(&h, index), nil
|
||||
}
|
||||
Reference in New Issue
Block a user