bitcoin: getblocktemplate fails for regtest mode.

Describe the issue

In the lightning tests, we run bitcoind in regtest mode. ~We started seeing intermittent test failures, caused by generate not including transactions we had just sendrawtransactioned; this delay is noticeable when there are multiple submitted txs.~ (Edit: my test harness fail). I tried to work around it by polling getblocktemplate to see when our txs are included, only to run into this bug 😦

  1. bitcoind -regtest -testnet=0 &
  2. bitcoin-cli -regtest -testnet=0 getblocktemplate

Expected behaviour

I should get the block template.

Actual behaviour

error code: -9 error message: Bitcoin is not connected!

What version of bitcoin-core are you using?

v0.14.2.0-gfc61c83

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

I have the same issue. How can I test getblocktemplate without using testnet, as waiting for sync takes too much time.

@achow101 That’s not very sane for regtest, is it? And the unreliable sendrawtransaction/generate behavior on regtest seems to be most simply fixed by allowing this.