lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.73k stars 2.09k forks source link

Runtime error with bitcoind backend #621

Closed torkelrogstad closed 6 years ago

torkelrogstad commented 6 years ago

I've been trying out the new bitcoind backend mode, and I've been having some issues.

After starting bitcoind (and ensuring it syncs completely before doing anything else), lnd gives me this errror:

2018-01-18 11:02:01.643 [INF] LTND: Version 0.3.0-alpha
2018-01-18 11:02:01.643 [INF] CHDB: Checking for schema update: latest_version=0, db_version=0
2018-01-18 11:02:01.643 [INF] LTND: Primary chain is set to: bitcoin
2018-01-18 11:02:01.643 [INF] LTND: Initializing bitcoind backed fee estimator
2018-01-18 11:02:02.337 [INF] LNWL: Opened wallet
panic: runtime error: index out of range

goroutine 10 [running]:
github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/gozmq.connFromAddr(0x0, 0x0, 0x0, 0x0, 0x3, 0xc4201fc780)
        /home/torkel/goprojects/src/github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/gozmq/zmq.go:286 +0x467
github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/gozmq.Subscribe(0x0, 0x0, 0xc4201bbeb0, 0x2, 0x2, 0x5f5e100, 0x0, 0x0, 0xc420066700)
        /home/torkel/goprojects/src/github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/gozmq/zmq.go:312 +0x4d
github.com/lightningnetwork/lnd/vendor/github.com/roasbeef/btcwallet/chain.(*BitcoindClient).socketHandler(0xc4201da540)
        /home/torkel/goprojects/src/github.com/lightningnetwork/lnd/vendor/github.com/roasbeef/btcwallet/chain/bitcoind.go:515 +0xf3
created by github.com/lightningnetwork/lnd/vendor/github.com/roasbeef/btcwallet/chain.(*BitcoindClient).Start
        /home/torkel/goprojects/src/github.com/lightningnetwork/lnd/vendor/github.com/roasbeef/btcwallet/chain/bitcoind.go:368 +0x160

My lnd.conf looks like this:

[Application Options]
no-macaroons=true
noencryptwallet=true

[Bitcoin]
bitcoin.active=true
bitcoin.testnet=true
bitcoin.node=bitcoind

[bitcoind]
bitcoind.rpcuser=xxx
bitcoind.rpcpass=xxx

My bitcoin.conf looks like this:

testnet=1
rpcuser=xxx
rpcpassword=xxx
server=1
txindex=1
zmqpubrawblock=tcp://127.0.0.1:29000
zmqpubrawtx=tcp://127.0.0.1:29000

I'm running Ubuntu 17.10, with Go version 1.9.2.

aakselrod commented 6 years ago

We have a fix for this coming up as another user has also reported the same issue. In the meantime, please make sure you specify either all or none of bitcoind.rpcuser, bitcoind.rpcpass, and bitcoind.zmqpath under the [Bitcoind] section in lnd.conf. You can use bitcoind.zmqpath=tcp://127.0.0.1:29000.

torkelrogstad commented 6 years ago

Worked like a charm! Thanks for the fix.

melvincarvalho commented 6 years ago

Same issue. But will follow instructions above.