mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-16 13:00:39 +02:00
Merge pull request #83 from halseth/chanpoint-reversed
poolcli: output reversed chanpoint
This commit is contained in:
commit
1979dbbe40
1 changed files with 4 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue