channeldb: store hold invoice

This commit is contained in:
Joost Jager committed 2019-03-15 10:08:55 +01:00
1 parent 8392f6d28f
commit 19f79613df
7 files changed
+111 -43

No files matched your search

+8 -3
View File
@@ -65,11 +65,10 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
invoice.Terms.State)
}
return &lnrpc.Invoice{
rpcInvoice := &lnrpc.Invoice{
Memo: string(invoice.Memo[:]),
Receipt: invoice.Receipt[:],
RHash: decoded.PaymentHash[:],
RPreimage: preimage[:],
Value: int64(satAmt),
CreationDate: invoice.CreationDate.Unix(),
SettleDate: settleDate,
@@ -87,7 +86,13 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
AmtPaidMsat: int64(invoice.AmtPaid),
AmtPaid: int64(invoice.AmtPaid),
State: state,
}, nil
}
if preimage != channeldb.UnknownPreimage {
rpcInvoice.RPreimage = preimage[:]
}
return rpcInvoice, nil
}
// CreateRPCRouteHints takes in the decoded form of an invoice's route hints