You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
When executing the example code, I came across the following error, which, as far as I understood, is related to the field header of the wallet object in the Invoice function in the lnpay.go file.
$ go run lnpay-test.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6c36cc]
That's because we didn't handle the error from CreateWallet on the example (so the example wasn't bloated). You must always handle the error there in real code. It will probably say that you used an invalid API Key or something like that.
Thank you.
I checked the error from CreateWallet and it was nil, And I tested with a real sak then even the wallet was created in the dashboard. But that error is still occurring.
I put a fmt.Println(wal.header) after line 67 of lnpay.go (err = resp.ToJSON(&wal)) and resulted in the panic error in that line.
May it mean that lnpay has a problem with my IP, and doesn't answer correctly to that?
Or does the version of go matter? It's 1.15
Hi!
When executing the example code, I came across the following error, which, as far as I understood, is related to the field header of the wallet object in the Invoice function in the lnpay.go file.
$ go run lnpay-test.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6c36cc]
goroutine 1 [running]:
github.com/lnpay/lnpay-go.(*Wallet).Invoice(0xc00014dc80, 0x74d95e, 0xe, 0x3e8, 0x0, 0xc000324120, 0x74a370, 0x0, 0x0, 0x0, ...)
/home/smorz/go/pkg/mod/github.com/lnpay/lnpay-go@v1.1.0/lnpay.go:142 +0xec
main.main()
/home/smorz/programs/lnpay-test/lnpay-test.go:21 +0x365
exit status 2
The text was updated successfully, but these errors were encountered: