multi: populate both string and byte TXID in lnrpc.Outpoint

This commit adds a a new `MarshalOutPoint` helper in the `lnrpc` package
that can be used to convert a `wire.Outpoint` to an `lnrpc.Outpoint`.
By using this helper, we are less likely to forget to populate both the
string and byte form of the TXID.
This commit is contained in:
Elle Mouton committed 2023-04-24 16:19:26 +02:00
1 parent 4355ce62d2
commit 7b186716a1
6 files changed
+22 -25

No files matched your search

+1 -5
View File
@@ -4496,11 +4496,7 @@ func rpcChannelResolution(report *channeldb.ResolverReport) (*lnrpc.Resolution,
res := &lnrpc.Resolution{
AmountSat: uint64(report.Amount),
Outpoint: &lnrpc.OutPoint{
OutputIndex: report.OutPoint.Index,
TxidStr: report.OutPoint.Hash.String(),
TxidBytes: report.OutPoint.Hash[:],
},
Outpoint: lnrpc.MarshalOutPoint(&report.OutPoint),
}
if report.SpendTxID != nil {