Merge pull request #83 from halseth/chanpoint-reversed

poolcli: output reversed chanpoint
This commit is contained in:
Johan T. Halseth 2020-09-17 20:17:23 +02:00 committed by GitHub
commit 1979dbbe40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ import (
"encoding/hex"
"fmt"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/lightninglabs/pool/poolrpc"
"github.com/urfave/cli"
)
@ -22,9 +23,10 @@ type Lease struct {
// NewLeaseFromProto creates a display Lease from its proto.
func NewLeaseFromProto(a *poolrpc.Lease) *Lease {
chanPoint := fmt.Sprintf("%x:%v", a.ChannelPoint.Txid,
a.ChannelPoint.OutputIndex)
var opHash chainhash.Hash
copy(opHash[:], a.ChannelPoint.Txid)
chanPoint := fmt.Sprintf("%v:%d", opHash, a.ChannelPoint.OutputIndex)
return &Lease{
ChannelPoint: chanPoint,
ChannelAmtSat: a.ChannelAmtSat,