8
8
"strings"
9
9
10
10
"github.com/btcsuite/btcd/btcec/v2"
11
+ "github.com/btcsuite/btcd/wire"
11
12
"github.com/lightningnetwork/lnd/keychain"
12
13
)
13
14
@@ -109,16 +110,10 @@ func ExtractSummaryFromDump(data string) ([]*SummaryEntry, error) {
109
110
for _ , match := range matches {
110
111
if len (match ) == 5 {
111
112
chanPoint := strings .TrimSpace (match [1 ])
112
- chanPointParts := strings .Split (chanPoint , ":" )
113
- if len (chanPointParts ) != 2 {
114
- return nil , fmt .Errorf ("invalid chanPoint: %s" ,
115
- chanPoint )
116
- }
117
- txid := chanPointParts [0 ]
118
- index , err := strconv .Atoi (chanPointParts [1 ])
113
+ parsedOP , err := wire .NewOutPointFromString (chanPoint )
119
114
if err != nil {
120
115
return nil , fmt .Errorf ("unable to parse " +
121
- "index : %w" , err )
116
+ "outpoint : %w" , err )
122
117
}
123
118
124
119
capacity , err := strconv .ParseFloat (match [3 ], 64 )
@@ -130,8 +125,8 @@ func ExtractSummaryFromDump(data string) ([]*SummaryEntry, error) {
130
125
results = append (results , & SummaryEntry {
131
126
RemotePubkey : match [2 ],
132
127
ChannelPoint : chanPoint ,
133
- FundingTXID : txid ,
134
- FundingTXIndex : uint32 ( index ) ,
128
+ FundingTXID : parsedOP . Hash . String () ,
129
+ FundingTXIndex : parsedOP . Index ,
135
130
Capacity : uint64 (
136
131
capacity * 1e8 ,
137
132
),
0 commit comments