Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ bitcoind -daemon -testnet
```

Wait until `bitcoind` has synchronized with the testnet network.
In case you use regtest, make sure you generate at least 432 blocks to
activate SegWit.

Make sure that you do not have `walletbroadcast=0` in your
`~/.bitcoin/bitcoin.conf`, or you may run into trouble.
Expand Down
7 changes: 4 additions & 3 deletions contrib/Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM ubuntu:16.04
MAINTAINER Christian Decker <decker.christian@gmail.com>

ENV DEBIAN_FRONTEND noninteractive
ENV BITCOIN_VERSION 0.16.0
WORKDIR /build

RUN apt-get -qq update && \
Expand Down Expand Up @@ -30,10 +31,10 @@ RUN apt-get -qq update && \
rm -rf /var/lib/apt/lists/*

RUN cd /tmp/ && \
wget https://bitcoin.org/bin/bitcoin-core-0.15.1/bitcoin-0.15.1-x86_64-linux-gnu.tar.gz -O bitcoin.tar.gz && \
wget https://bitcoin.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz -O bitcoin.tar.gz && \
tar -xvzf bitcoin.tar.gz && \
mv /tmp/bitcoin-0.15.1/bin/bitcoin* /usr/local/bin/ && \
rm -rf bitcoin.tar.gz /tmp/bitcoin-0.15.1
mv /tmp/bitcoin-$BITCOIN_VERSION/bin/bitcoin* /usr/local/bin/ && \
rm -rf bitcoin.tar.gz /tmp/bitcoin-$BITCOIN_VERSION

RUN pip3 install --upgrade pip && \
pip3 install python-bitcoinlib==0.7.0 pytest==3.0.5 setuptools==36.6.0 pytest-test-groups==1.0.3 flake8==3.5.0 pytest-rerunfailures==3.1
7 changes: 4 additions & 3 deletions contrib/Dockerfile.builder.i386
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM i386/ubuntu:16.04
MAINTAINER Christian Decker <decker.christian@gmail.com>

ENV DEBIAN_FRONTEND noninteractive
ENV BITCOIN_VERSION 0.16.0
WORKDIR /build

RUN apt-get -qq update && \
Expand Down Expand Up @@ -30,10 +31,10 @@ RUN apt-get -qq update && \
rm -rf /var/lib/apt/lists/*

RUN cd /tmp/ && \
wget https://bitcoin.org/bin/bitcoin-core-0.15.1/bitcoin-0.15.1-i686-pc-linux-gnu.tar.gz -O bitcoin.tar.gz && \
wget https://bitcoin.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-i686-pc-linux-gnu.tar.gz -O bitcoin.tar.gz && \
tar -xvzf bitcoin.tar.gz && \
mv /tmp/bitcoin-0.15.1/bin/bitcoin* /usr/local/bin/ && \
rm -rf bitcoin.tar.gz /tmp/bitcoin-0.15.1
mv /tmp/bitcoin-$BITCOIN_VERSION/bin/bitcoin* /usr/local/bin/ && \
rm -rf bitcoin.tar.gz /tmp/bitcoin-$BITCOIN_VERSION

RUN pip3 install --upgrade pip && \
pip3 install python-bitcoinlib==0.7.0 pytest==3.0.5 setuptools==36.6.0 pytest-test-groups==1.0.3 flake8==3.5.0 pytest-rerunfailures==3.1
24 changes: 15 additions & 9 deletions tests/test_lightningd.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ def setupBitcoind(directory):
teardown_bitcoind()
raise

info = bitcoind.rpc.getnetworkinfo()

if info['version'] < 160000:
bitcoind.rpc.stop()
raise ValueError("bitcoind is too old. At least version 16000 (v0.16.0)"
" is needed, current version is {}".format(info['version']))

info = bitcoind.rpc.getblockchaininfo()
# Make sure we have segwit and some funds
if info['blocks'] < 432:
logging.debug("SegWit not active, generating some more blocks")
bitcoind.generate_block(432 - info['blocks'])
# Make sure we have some spendable funds
if info['blocks'] < 101:
bitcoind.generate_block(101 - info['blocks'])
elif bitcoind.rpc.getwalletinfo()['balance'] < 1:
logging.debug("Insufficient balance, generating 1 block")
bitcoind.generate_block(1)
Expand Down Expand Up @@ -2715,7 +2721,7 @@ def test_closing_negotiation_reconnect(self):
l2.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE'])
assert l1.bitcoin.rpc.getmempoolinfo()['size'] == 1

@unittest.skip("FIXME: needs bitcoind 0.16")
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
def test_bech32_funding(self):
# Don't get any funds from previous runs.
l1 = self.node_factory.get_node(random_hsm=True)
Expand Down Expand Up @@ -3326,10 +3332,10 @@ def test_channel_reenable(self):
l2.daemon.start()

# Now they should sync and re-establish again
l1.daemon.wait_for_logs(['Received channel_update for channel 434:1:1.1.',
'Received channel_update for channel 434:1:1.0.'])
l2.daemon.wait_for_logs(['Received channel_update for channel 434:1:1.1.',
'Received channel_update for channel 434:1:1.0.'])
l1.daemon.wait_for_logs(['Received channel_update for channel \\d+:1:1.1.',
'Received channel_update for channel \\d+:1:1.0.'])
l2.daemon.wait_for_logs(['Received channel_update for channel \\d+:1:1.1.',
'Received channel_update for channel \\d+:1:1.0.'])
wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True, True])

@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
Expand Down