Merge pull request #172 from javiervargas/patch-10

Update 19_2_Paying_a_Invoice.md
This commit is contained in:
Shannon Appelcline 2020-09-15 11:17:04 -10:00 committed by GitHub
commit b35fad2621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,16 @@ Check ln invoice:
`lntb1m1p03ft7lpp5zve4dsgwgdxekqqq39vhgcnv6gfa2g2ktqy9lf0aph60d0388xmqdqqcqzpgsp545a9fphd8m5ayplcu8m5845cr4m0zcnyxddwv4g3zm32yprkfd4q9qy9qsq3s4y6cmyvh0qw9qm0sf80llxyyjy9xwrjds7lpkqhzv247jsm6q5me8t9e6ftquma664gz5u4a2rvs0yf4f0mlwtwfs6as5uj5djzhcqpnqlcj
`
This invoice starts with prefix ln+tb+1m that indicates milli, so you should multi by 0.001. That means we'll pay an invoice by 100000 satoshis.
This invoice starts with prefix ln+tb+1m that indicates milli, so you should multi by 0.001. That means we'll pay an invoice by 100,000 satoshis.
The value `amount` could be a number in that currency, followed by an optional `multiplier` letter.
The following `multiplier` letters are defined:
* `m` (milli): multiply by 0.001
* `u` (micro): multiply by 0.000001
* `n` (nano): multiply by 0.000000001
* `p` (pico): multiply by 0.000000000001
### Understanding your invoice
@ -48,7 +57,7 @@ Check payee value is the same as identity_pubkey value seen previous chapter.
### Check your balance
As we did in previous chapter we have established an channel with a total capacity of 280.000 sats. This will be channel used to pay the invoice.
As we did in previous chapter we have established an channel with a total capacity of 280,000 sats. This will be channel used to pay the invoice.
```
c$ lightning-cli --network=testnet listfunds
@ -85,6 +94,7 @@ c$ lightning-cli --network=testnet listfunds
### Paying your invoice
You should use `lightning-cli pay ` command to pay the invoice. The pay RPC command attempts to find a route to the given destination, and send the funds asked in amount value.
Notice amount is expressed in milli-satoshi.
```
@ -107,7 +117,7 @@ lntb1m1p03ft7lpp5zve4dsgwgdxekqqq39vhgcnv6gfa2g2ktqy9lf0aph60d0388xmqdqqcqzpgsp5
### Check your balance
We've performed payment successfully and gets decreased channel balance on our side. Now it has 180000 as available balance.
We've performed payment successfully and gets decreased channel balance on our side. Now it has 180,000 as available balance.
```
c$ lightning-cli --network=testnet listfunds
@ -144,7 +154,7 @@ c$ lightning-cli --network=testnet listfunds
## Summary: Paying a Invoice
We've created an invoice by 100.000 satoshis using a second machine and we've payed it using our main Lightning network node c-lightning. The channel was created with an initial amount of 280000 satoshis. This is called Total capacity channel. Later we've payed invoice we proved local balance was reduced remaining at 180.000 satoshis.
We've created an invoice by 100,000 satoshis using a second machine and we've payed it using our main Lightning network node c-lightning. The channel was created with an initial amount of 280,000 satoshis. This is called Total capacity channel. Later we've payed invoice we proved local balance was reduced remaining at 180,000 satoshis.
## What's Next?