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
2023-04-21 14:51:56 +02:00
parent 4355ce62d2
commit 7b186716a1
6 changed files with 22 additions and 25 deletions

View File

@@ -265,11 +265,7 @@ func (r *Manager) getHtlcAmtLimits(tx kvdb.RTx, chanPoint wire.OutPoint) (
func makeFailureItem(outPoint wire.OutPoint, updateFailure lnrpc.UpdateFailure,
errStr string) *lnrpc.FailedUpdate {
outpoint := &lnrpc.OutPoint{
TxidBytes: outPoint.Hash[:],
TxidStr: outPoint.Hash.String(),
OutputIndex: outPoint.Index,
}
outpoint := lnrpc.MarshalOutPoint(&outPoint)
return &lnrpc.FailedUpdate{
Outpoint: outpoint,