invoicesrpc+lnrpc: add msat fields to invoices

This commit is contained in:
Joost Jager committed 2019-11-15 08:59:35 +01:00
1 parent 2ab16f7601
commit fcbf1bc07a
9 files changed
+660 -590

No files matched your search

+6 -2
View File
@@ -11,7 +11,6 @@ import (
"google.golang.org/grpc"
"gopkg.in/macaroon-bakery.v2/bakery"
"github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lntypes"
@@ -261,10 +260,15 @@ func (s *Server) AddHoldInvoice(ctx context.Context,
return nil, err
}
value, err := lnrpc.UnmarshallAmt(invoice.Value, invoice.ValueMsat)
if err != nil {
return nil, err
}
addInvoiceData := &AddInvoiceData{
Memo: invoice.Memo,
Hash: &hash,
Value: btcutil.Amount(invoice.Value),
Value: value,
DescriptionHash: invoice.DescriptionHash,
Expiry: invoice.Expiry,
FallbackAddr: invoice.FallbackAddr,