Hack A Lapp/Introduction to Bitcoins Lightning Network App Development/C-Lightning with python/Check which payments have been received/quiz

From Wikiversity
Jump to navigation Jump to search

1 the call to rpc_interfce.listinvoices()["invoices"] returns a list on invoices what are the values the status of each invoice can take?

paid
Paid
Unpaid
expired
pending

2 What happens if you call function rpc_interfce.listinvoices("some-string")["invoices"]?

only the invoice with the description some string will be returned
only the invoice with the label some string will be returned
the listinvoices function does not accept any arguments!

3 you have done this statement invoice = rpc_interfce.listinvoices("some-string")["invoices"] and some value was returned. How can you access the amount of the invoice?

by using the rpc_interfce.decodepay(invoice) call
by invoice.amount()
by invoice["amount"]
the amount can be extracted with some regular expression from the human readable part of the bolt11 string which can be accessed with invoice["bolt11"]]