move basetypes into lightning

This commit is contained in:
Jesse de Wit
2023-09-04 09:29:01 +02:00
parent b8e67a2968
commit d98e041e94
13 changed files with 34 additions and 39 deletions

19
lightning/outpoint.go Normal file
View 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
}