Skip to content

Commit c041c75

Browse files
committed
better logs for debugging bitcoind connection failures.
1 parent 92e6f21 commit c041c75

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ apt install lightningd
4141
mkdir -p ~/.lightning/plugins
4242
echo 'disable-plugin=bcli' >> .lightning/config
4343
cd ~/.lightning/plugins
44-
wget https://github.com/nbd-wtf/trustedcoin/releases/download/v0.8.3/trustedcoin-v0.8.3-linux-amd64.tar.gz
45-
tar -xvf trustedcoin-v0.8.3-linux-amd64.tar.gz
44+
wget https://github.com/nbd-wtf/trustedcoin/releases/download/v0.8.4/trustedcoin-v0.8.4-linux-amd64.tar.gz
45+
tar -xvf trustedcoin-v0.8.4-linux-amd64.tar.gz
4646
cd
4747
lightningd
4848
```

main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ func main() {
188188
}
189189
}
190190

191+
p.Logf("bitcoind RPC settings: {user: %s, password: %s, connect: %s, port: %s}", user, pass, hostname, port)
192+
191193
client, err := rpcclient.New(&rpcclient.ConnConfig{
192194
Host: hostname + ":" + port,
193195
User: user,
@@ -196,15 +198,15 @@ func main() {
196198
DisableTLS: true,
197199
}, nil)
198200
if err != nil {
199-
p.Log("bitcoind RPC backend settings detected but invalid, will only use block explorers.")
201+
p.Logf("bitcoind RPC backend settings detected but invalid (%s), will only use block explorers.", err)
200202
return
201203
}
202204

203205
bitcoind = client
204206
if _, err := bitcoind.GetBlockChainInfo(); err == nil {
205207
p.Log("bitcoind RPC working, will use that with highest priority and fall back to block explorers if it fails.")
206208
} else {
207-
p.Log("bitcoind RPC backend settings detected, but failed to connect, will keep trying to use it though.")
209+
p.Log("bitcoind RPC backend settings detected, but failed to connect (%s), will keep trying to use it though.", err)
208210
}
209211
return
210212
}

0 commit comments

Comments
 (0)