Showing with 1,662 additions and 1,548 deletions.
  1. +0 −1 .github/workflows/bsd.yml
  2. +2 −2 .github/workflows/ci.yaml
  3. +6 −1 .gitmodules
  4. +39 −0 CHANGELOG.md
  5. +2 −8 Makefile
  6. +4 −0 channeld/channeld.c
  7. +13 −5 common/gossip_store.c
  8. +1 −4 common/gossmap.c
  9. +8 −1 configure
  10. +0 −1 contrib/docker/Dockerfile.alpine
  11. +1 −2 contrib/docker/Dockerfile.builder
  12. +1 −1 contrib/docker/Dockerfile.builder.fedora
  13. +2 −4 contrib/docker/Dockerfile.ubuntu
  14. +0 −1 contrib/docker/linuxarm32v7.Dockerfile
  15. +0 −1 contrib/docker/linuxarm64v8.Dockerfile
  16. +0 −5 contrib/docker/scripts/setup.sh
  17. +1 −1 contrib/pyln-client/pyln/client/__init__.py
  18. +2 −6 contrib/pyln-client/pyln/client/plugin.py
  19. +1 −1 contrib/pyln-proto/pyln/proto/__init__.py
  20. +1 −1 contrib/pyln-testing/pyln/testing/__init__.py
  21. +8 −2 contrib/pyln-testing/pyln/testing/utils.py
  22. +6 −3 doc/INSTALL.md
  23. +13 −4 doc/Makefile
  24. +1 −1 doc/lightning-addgossip.7.md
  25. +5 −3 doc/lightning-autocleaninvoice.7.md
  26. +24 −23 doc/lightning-bkpr-channelsapy.7.md
  27. +4 −3 doc/lightning-bkpr-dumpincomecsv.7.md
  28. +11 −10 doc/lightning-bkpr-inspect.7.md
  29. +12 −8 doc/lightning-bkpr-listaccountevents.7.md
  30. +11 −9 doc/lightning-bkpr-listbalances.7.md
  31. +6 −5 doc/lightning-bkpr-listincome.7.md
  32. +3 −2 doc/lightning-check.7.md
  33. +2 −1 doc/lightning-checkmessage.7.md
  34. +50 −36 doc/lightning-cli.1.md
  35. +3 −1 doc/lightning-close.7.md
  36. +5 −3 doc/lightning-commando-rune.7.md
  37. +4 −1 doc/lightning-connect.7.md
  38. +11 −10 doc/lightning-createinvoice.7.md
  39. +3 −2 doc/lightning-createonion.7.md
  40. +2 −1 doc/lightning-datastore.7.md
  41. +82 −72 doc/lightning-decode.7.md
  42. +13 −12 doc/lightning-decodepay.7.md
  43. +2 −1 doc/lightning-deldatastore.7.md
  44. +1 −1 doc/lightning-delexpiredinvoice.7.md
  45. +13 −10 doc/lightning-delinvoice.7.md
  46. +7 −6 doc/lightning-delpay.7.md
  47. +5 −4 doc/lightning-disableoffer.7.md
  48. +1 −1 doc/lightning-disconnect.7.md
  49. +22 −20 doc/lightning-feerates.7.md
  50. +8 −7 doc/lightning-fetchinvoice.7.md
  51. +4 −3 doc/lightning-fundchannel.7.md
  52. +2 −1 doc/lightning-fundchannel_cancel.7.md
  53. +4 −3 doc/lightning-fundchannel_complete.7.md
  54. +6 −4 doc/lightning-fundchannel_start.7.md
  55. +17 −16 doc/lightning-funderupdate.7.md
  56. +8 −7 doc/lightning-fundpsbt.7.md
  57. +12 −9 doc/lightning-getinfo.7.md
  58. +11 −7 doc/lightning-getlog.7.md
  59. +3 −2 doc/lightning-getroute.7.md
  60. +2 −1 doc/lightning-help.7.md
  61. +16 −12 doc/lightning-hsmtool.8.md
  62. +11 −9 doc/lightning-invoice.7.md
  63. +9 −7 doc/lightning-keysend.7.md
  64. +11 −10 doc/lightning-listchannels.7.md
  65. +2 −1 doc/lightning-listconfigs.7.md
  66. +2 −1 doc/lightning-listdatastore.7.md
  67. +14 −10 doc/lightning-listforwards.7.md
  68. +15 −10 doc/lightning-listfunds.7.md
  69. +12 −10 doc/lightning-listinvoices.7.md
  70. +15 −11 doc/lightning-listnodes.7.md
  71. +5 −4 doc/lightning-listoffers.7.md
  72. +10 −6 doc/lightning-listpays.7.md
  73. +78 −67 doc/lightning-listpeers.7.md
  74. +9 −6 doc/lightning-listsendpays.7.md
  75. +3 −2 doc/lightning-listtransactions.7.md
  76. +2 −1 doc/lightning-makesecret.7.md
  77. +5 −4 doc/lightning-multifundchannel.7.md
  78. +2 −1 doc/lightning-multiwithdraw.7.md
  79. +2 −1 doc/lightning-newaddr.7.md
  80. +1 −1 doc/lightning-notifications.7.md
  81. +5 −4 doc/lightning-offer.7.md
  82. +5 −4 doc/lightning-offerout.7.md
  83. +4 −3 doc/lightning-openchannel_abort.7.md
  84. +5 −4 doc/lightning-openchannel_bump.7.md
  85. +5 −4 doc/lightning-openchannel_init.7.md
  86. +3 −2 doc/lightning-openchannel_signed.7.md
  87. +6 −5 doc/lightning-openchannel_update.7.md
  88. +2 −1 doc/lightning-parsefeerate.7.md
  89. +9 −7 doc/lightning-pay.7.md
  90. +2 −1 doc/lightning-ping.7.md
  91. +4 −1 doc/lightning-plugin.7.md
  92. +4 −3 doc/lightning-reserveinputs.7.md
  93. +2 −1 doc/lightning-sendcustommsg.7.md
  94. +10 −8 doc/lightning-sendinvoice.7.md
  95. +9 −6 doc/lightning-sendonion.7.md
  96. +1 −1 doc/lightning-sendonionmessage.7.md
  97. +9 −6 doc/lightning-sendpay.7.md
  98. +2 −1 doc/lightning-sendpsbt.7.md
  99. +11 −10 doc/lightning-setchannel.7.md
  100. +5 −4 doc/lightning-setchannelfee.7.md
  101. +2 −1 doc/lightning-signmessage.7.md
  102. +3 −2 doc/lightning-signpsbt.7.md
  103. +1 −1 doc/lightning-stop.7.md
  104. +3 −2 doc/lightning-txdiscard.7.md
  105. +3 −2 doc/lightning-txprepare.7.md
  106. +2 −1 doc/lightning-txsend.7.md
  107. +5 −3 doc/lightning-unreserveinputs.7.md
  108. +8 −7 doc/lightning-utxopsbt.7.md
  109. +10 −8 doc/lightning-waitanyinvoice.7.md
  110. +2 −1 doc/lightning-waitblockheight.7.md
  111. +10 −8 doc/lightning-waitinvoice.7.md
  112. +8 −6 doc/lightning-waitsendpay.7.md
  113. +2 −1 doc/lightning-withdraw.7.md
  114. +266 −197 doc/lightningd-config.5.md
  115. +20 −20 doc/lightningd.8.md
  116. +14 −0 external/Makefile
  117. +1 −0 external/lowdown
  118. +0 −3 gossipd/gossipd.c
  119. +7 −0 lightningd/channel.h
  120. +8 −2 lightningd/coin_mvts.c
  121. +2 −0 lightningd/lightningd.c
  122. +4 −0 lightningd/lightningd.h
  123. +115 −84 lightningd/peer_control.c
  124. +6 −0 openingd/dualopend.c
  125. +3 −0 openingd/openingd.c
  126. +2 −2 plugins/bkpr/Makefile
  127. +46 −0 plugins/bkpr/db.c
  128. +14 −5 plugins/libplugin.c
  129. +89 −566 poetry.lock
  130. +2 −2 pyproject.toml
  131. BIN tests/data/dupe_lease_fee.sqlite3.xz
  132. +16 −1 tests/test_bookkeeper.py
  133. +12 −0 tests/test_connection.py
  134. +5 −0 tests/test_gossip.py
  135. +118 −0 tests/test_opening.py
  136. +2 −0 tools/build-release.sh
  137. +1 −1 tools/check-manpage.sh
  138. +14 −9 tools/fromschema.py
  139. +16 −0 tools/md2man.sh
  140. +2 −2 wallet/Makefile
1 change: 0 additions & 1 deletion .github/workflows/bsd.yml
Expand Up @@ -63,7 +63,6 @@ jobs:
blinker \
flake8 \
mako \
mrkd \
pytest-sentry \
pytest-test-groups==1.0.3 \
pytest-custom-exit-code==0.3.0 \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Expand Up @@ -99,7 +99,7 @@ jobs:
proto-test:
name: Protocol Test Config
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 300
needs: [smoke-test]
strategy:
Expand All @@ -122,7 +122,7 @@ jobs:
-e VALGRIND=${{ matrix.valgrind }} \
-e DEVELOPER=1 \
-e EXPERIMENTAL_FEATURES=1 \
-e COMPA=0 \
-e COMPAT=0 \
-e PYTEST_PAR=2 \
-e PYTEST_OPTS="--timeout=300" \
-e TEST_CMD="make check-protos" \
Expand Down
7 changes: 6 additions & 1 deletion .gitmodules
Expand Up @@ -16,4 +16,9 @@
url = https://github.com/valyala/gheap
[submodule "external/lnprototest"]
path = external/lnprototest
url = https://github.com/rustyrussell/lnprototest.git
url = https://github.com/niftynei/lnprototest.git
branch = nifty/ripemd160-fallback
[submodule "external/lowdown"]
path = external/lowdown
url = https://github.com/kristapsdz/lowdown.git
ignore = dirty
39 changes: 39 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
TODO: Insert version codename, and username of the contributor that named the release.
-->

## [0.12.1] - 2022-09-13: Web-8 init (dot one)

Point release with some bugfixes and patches.

### Added

None

### Changed

None

### Deprecated

None

### Removed

- build: `mrkd` and `mistune` not required to build project

### Fixed

- lnprototest: builds for lnprototest tests now use 22.04 LTS, which fixes a problem with loading `mako`. ([#5583])
- Plugins: topology plugin could crash when it sees duplicate private channel announcements ([#5593])
- connectd: proper `gossip_store` operation may resolve some previous gossip propagation issues and connectd crashes ([#5591])
- connectd: Fixed a condition for newly created channels that could trigger a need for reconnect. ([#5601])
- `peer_control`: getinfo showing unannounced addresses. ([#5584])
- `peer_control`: getinfo shows the correct port on discovered IPs ([#5585])


[#5583]: https://github.com/ElementsProject/lightning/pull/5583
[#5584]: https://github.com/ElementsProject/lightning/pull/5584
[#5585]: https://github.com/ElementsProject/lightning/pull/5585
[#5593]: https://github.com/ElementsProject/lightning/pull/5593
[#5591]: https://github.com/ElementsProject/lightning/pull/5591
[#5601]: https://github.com/ElementsProject/lightning/pull/5601


## [0.12.0] - 2022-08-23: Web-8 init

This release named by @adi2011.
Expand Down Expand Up @@ -1863,6 +1901,7 @@ There predate the BOLT specifications, and are only of vague historic interest:
6. [0.5.1] - 2016-10-21
7. [0.5.2] - 2016-11-21: "Bitcoin Savings & Trust Daily Interest II"

[0.12.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.12.1
[0.12.0]: https://github.com/ElementsProject/lightning/releases/tag/v0.12.0
[0.11.2]: https://github.com/ElementsProject/lightning/releases/tag/v0.11.2
[0.11.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.11.1
Expand Down
10 changes: 2 additions & 8 deletions Makefile
Expand Up @@ -317,19 +317,13 @@ endif
ifeq ($(SUPPRESS_GENERATION),1)
SHA256STAMP_CHANGED = false
SHA256STAMP = exit 1
SHA256STAMP_CHANGED_ALL = false
SHA256STAMP_ALL = exit 1
else
# Git doesn't maintain timestamps, so we only regen if sources actually changed:
# We place the SHA inside some generated files so we can tell if they need updating.
# Usage: $(call SHA256STAMP_CHANGED)
SHA256STAMP_CHANGED = [ x"`sed -n 's/.*SHA256STAMP:\([a-f0-9]*\).*/\1/p' $@ 2>/dev/null`" != x"`cat $(sort $(filter-out FORCE,$<)) | $(SHA256SUM) | cut -c1-64`" ]
SHA256STAMP_CHANGED = [ x"`sed -n 's/.*SHA256STAMP:\([a-f0-9]*\).*/\1/p' $@ 2>/dev/null`" != x"`cat $(sort $(filter-out FORCE,$^)) | $(SHA256SUM) | cut -c1-64`" ]
# Usage: $(call SHA256STAMP,commentprefix,commentpostfix)
SHA256STAMP = echo "$(1) SHA256STAMP:"`cat $(sort $(filter-out FORCE,$<)) | $(SHA256SUM) | cut -c1-64`"$(2)" >> $@

SHA256STAMP_CHANGED_ALL = [ x"`sed -n 's/.*SHA256STAMP:\([a-f0-9]*\).*/\1/p' $@ 2>/dev/null`" != x"`cat $(sort $(filter-out FORCE,$^)) | $(SHA256SUM) | cut -c1-64`" ]
# Usage: $(call SHA256STAMP,commentprefix,commentpostfix)
SHA256STAMP_ALL = echo "$(1) SHA256STAMP:"`cat $(sort $(filter-out FORCE,$^)) | $(SHA256SUM) | cut -c1-64`"$(2)" >> $@
SHA256STAMP = echo "$(1) SHA256STAMP:"`cat $(sort $(filter-out FORCE,$^)) | $(SHA256SUM) | cut -c1-64`"$(2)" >> $@
endif

# generate-wire.py --page [header|impl] hdrfilename wirename < csv > file
Expand Down
4 changes: 4 additions & 0 deletions channeld/channeld.c
Expand Up @@ -955,6 +955,10 @@ static void send_shutdown_complete(struct peer *peer)
wire_sync_write(MASTER_FD,
take(towire_channeld_shutdown_complete(NULL)));
per_peer_state_fdpass_send(MASTER_FD, peer->pps);

/* Give master a chance to pass the fd along */
sleep(1);

close(MASTER_FD);
}

Expand Down
18 changes: 13 additions & 5 deletions common/gossip_store.c
Expand Up @@ -115,6 +115,7 @@ u8 *gossip_store_next(const tal_t *ctx,
size_t *off, size_t *end)
{
u8 *msg = NULL;
size_t initial_off = *off;

while (!msg) {
struct gossip_hdr hdr;
Expand Down Expand Up @@ -146,6 +147,14 @@ u8 *gossip_store_next(const tal_t *ctx,
continue;
}

/* Messages can be up to 64k, but we also have internal ones:
* 128k is plenty. */
if (msglen > 128 * 1024)
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"gossip_store: oversize msg len %u at"
" offset %zu (was at %zu)",
msglen, *off, initial_off);

checksum = be32_to_cpu(hdr.crc);
msg = tal_arr(ctx, u8, msglen);
r = pread(*gossip_store_fd, msg, msglen, *off + r);
Expand All @@ -155,8 +164,8 @@ u8 *gossip_store_next(const tal_t *ctx,
if (checksum != crc32c(be32_to_cpu(hdr.timestamp), msg, msglen))
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"gossip_store: bad checksum at offset %zu"
": %s",
*off, tal_hex(tmpctx, msg));
"(was at %zu): %s",
*off, initial_off, tal_hex(tmpctx, msg));

/* Definitely processing it now */
*off += sizeof(hdr) + msglen;
Expand Down Expand Up @@ -190,8 +199,8 @@ size_t find_gossip_store_end(int gossip_store_fd, size_t off)
} buf;
int r;

while ((r = read(gossip_store_fd, &buf,
sizeof(buf.hdr) + sizeof(buf.type)))
while ((r = pread(gossip_store_fd, &buf,
sizeof(buf.hdr) + sizeof(buf.type), off))
== sizeof(buf.hdr) + sizeof(buf.type)) {
u32 msglen = be32_to_cpu(buf.hdr.len) & GOSSIP_STORE_LEN_MASK;

Expand All @@ -200,7 +209,6 @@ size_t find_gossip_store_end(int gossip_store_fd, size_t off)
break;

off += sizeof(buf.hdr) + msglen;
lseek(gossip_store_fd, off, SEEK_SET);
}
return off;
}
Expand Down
5 changes: 1 addition & 4 deletions common/gossmap.c
Expand Up @@ -414,11 +414,8 @@ static struct gossmap_chan *add_channel(struct gossmap *map,
* that's the only time we get duplicates */
scid.u64 = map_be64(map, cannounce_off + plus_scid_off);
chan = gossmap_find_chan(map, &scid);
if (chan) {
assert(chan->private);
assert(!private);
if (chan)
gossmap_remove_chan(map, chan);
}

/* We carefully map pointers to indexes, since new_node can move them! */
n[0] = gossmap_find_node(map, &node_id[0]);
Expand Down
9 changes: 8 additions & 1 deletion configure
Expand Up @@ -102,7 +102,7 @@ check_command()
shift 1

echo -n "checking for $name... "
if "$@" >/dev/null 2>&1; then
if "$@" >/dev/null 2>&1 </dev/null; then
echo 'found'
return 0
fi
Expand Down Expand Up @@ -417,6 +417,12 @@ else
HAVE_PYTHON3_MAKO=0
fi

if check_command 'lowdown' lowdown; then
HAVE_LOWDOWN=1
else
HAVE_LOWDOWN=0
fi

if echo | check_command sha256sum sha256sum; then
SHA256SUM=sha256sum
elif echo | check_command "shasum -a 256" shasum -a 256; then
Expand Down Expand Up @@ -455,6 +461,7 @@ add_var ASAN "$ASAN"
add_var UBSAN "$UBSAN"
add_var TEST_NETWORK "$TEST_NETWORK"
add_var HAVE_PYTHON3_MAKO "$HAVE_PYTHON3_MAKO"
add_var HAVE_LOWDOWN "$HAVE_LOWDOWN"
add_var SHA256SUM "$SHA256SUM"
add_var FUZZING "$FUZZING"
add_var RUST "$RUST"
Expand Down
1 change: 0 additions & 1 deletion contrib/docker/Dockerfile.alpine
Expand Up @@ -15,7 +15,6 @@ COPY . lightning
RUN cd lightning && \
git submodule update --init --recursive && \
./configure && \
pip3 install mrkd mistune==0.8.4 && \
make -j$(nproc) && \
make install

Expand Down
3 changes: 1 addition & 2 deletions contrib/docker/Dockerfile.builder
Expand Up @@ -65,5 +65,4 @@ RUN pip3 install --upgrade pip && \
tqdm==4.26.0 \
pytest-test-groups==1.0.3 \
flake8==3.5.0 \
pytest-rerunfailures==3.1 \
mrkd==0.1.6
pytest-rerunfailures==3.1
2 changes: 1 addition & 1 deletion contrib/docker/Dockerfile.builder.fedora
Expand Up @@ -32,4 +32,4 @@ RUN wget https://bitcoin.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_
rm -rf bitcoin.tar.gz bitcoin-$BITCOIN_VERSION

RUN python3 -m pip install --upgrade pip && \
python3 -m pip install python-bitcoinlib==0.10.2 pytest==3.0.5 setuptools==36.6.0 pytest-test-groups==1.0.3 flake8==3.5.0 pytest-rerunfailures==3.1 ephemeral-port-reserve==1.1.0 mrkd==0.1.6
python3 -m pip install python-bitcoinlib==0.10.2 pytest==3.0.5 setuptools==36.6.0 pytest-test-groups==1.0.3 flake8==3.5.0 pytest-rerunfailures==3.1 ephemeral-port-reserve==1.1.0
6 changes: 2 additions & 4 deletions contrib/docker/Dockerfile.ubuntu
@@ -1,10 +1,8 @@
FROM ubuntu:20.04
FROM ubuntu:22.04
LABEL mantainer="Vincenzo Palazzo vincenzopalazzodev@gmail.com"

WORKDIR /work

COPY . .

ENV DEBIAN_FRONTEND=noninteractive
ENV LANGUAGE=en_US.UTF-8
ENV LANG=en_US.UTF-8
Expand All @@ -23,7 +21,7 @@ RUN locale-gen en_US.UTF-8 && dpkg-reconfigure --frontend noninteractive tzdata

COPY . .

# install package for pytho cryptography lib
# install package for python cryptography lib
# https://cryptography.io/en/latest/installation/#debian-ubuntu

RUN apt-get -qq update && \
Expand Down
1 change: 0 additions & 1 deletion contrib/docker/linuxarm32v7.Dockerfile
Expand Up @@ -92,7 +92,6 @@ RUN git clone --recursive /tmp/lightning . && \

ARG DEVELOPER=0
ENV PYTHON_VERSION=3
RUN pip3 install mrkd
RUN ./configure --prefix=/tmp/lightning_install --enable-static && make -j3 DEVELOPER=${DEVELOPER} && make install

FROM arm32v7/debian:buster-slim as final
Expand Down
1 change: 0 additions & 1 deletion contrib/docker/linuxarm64v8.Dockerfile
Expand Up @@ -91,7 +91,6 @@ RUN git clone --recursive /tmp/lightning . && \

ARG DEVELOPER=0
ENV PYTHON_VERSION=3
RUN pip3 install mrkd
RUN ./configure --prefix=/tmp/lightning_install --enable-static && make -j3 DEVELOPER=${DEVELOPER} && make install

FROM arm64v8/debian:buster-slim as final
Expand Down
5 changes: 0 additions & 5 deletions contrib/docker/scripts/setup.sh
Expand Up @@ -6,8 +6,6 @@ export ELEMENTS_VERSION=0.18.1.8
export RUST_VERSION=nightly
export TZ="Europe/London"

sudo useradd -ms /bin/bash tester

sudo apt-get update -qq

sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \
Expand Down Expand Up @@ -54,9 +52,6 @@ sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \
zlib1g-dev


echo "tester ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/tester
sudo chmod 0440 /etc/sudoers.d/tester

(
cd /tmp/ || exit 1
wget https://storage.googleapis.com/c-lightning-tests/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2
Expand Down
2 changes: 1 addition & 1 deletion contrib/pyln-client/pyln/client/__init__.py
Expand Up @@ -2,7 +2,7 @@
from .plugin import Plugin, monkey_patch, RpcException
from .gossmap import Gossmap, GossmapNode, GossmapChannel, GossmapNodeId

__version__ = "0.12.0"
__version__ = "0.12.1"

__all__ = [
"LightningRpc",
Expand Down
8 changes: 2 additions & 6 deletions contrib/pyln-client/pyln/client/plugin.py
Expand Up @@ -72,7 +72,7 @@ def __init__(self, message: str, code: int = -32600):
class Request(dict):
"""A request object that wraps params and allows async return
"""
def __init__(self, plugin: 'Plugin', req_id: Optional[int], method: str,
def __init__(self, plugin: 'Plugin', req_id: Optional[str], method: str,
params: Any, background: bool = False):
self.method = method
self.params = params
Expand Down Expand Up @@ -700,13 +700,9 @@ def notify_progress(self, request: Request,
request.progress(progress, progress_total, stage, stage_total)

def _parse_request(self, jsrequest: Dict[str, JSONType]) -> Request:
i = jsrequest.get('id', None)
if not isinstance(i, int) and i is not None:
raise ValueError('Non-integer request id "{i}"'.format(i=i))

request = Request(
plugin=self,
req_id=i,
req_id=jsrequest.get('id', None),
method=str(jsrequest['method']),
params=jsrequest['params'],
background=False,
Expand Down
2 changes: 1 addition & 1 deletion contrib/pyln-proto/pyln/proto/__init__.py
Expand Up @@ -4,7 +4,7 @@
from .onion import OnionPayload, TlvPayload, LegacyOnionPayload
from .wire import LightningConnection, LightningServerSocket

__version__ = "0.12.0"
__version__ = "0.12.1"

__all__ = [
"Invoice",
Expand Down
2 changes: 1 addition & 1 deletion contrib/pyln-testing/pyln/testing/__init__.py
@@ -1,4 +1,4 @@
__version__ = "0.12.0"
__version__ = "0.12.1"

__all__ = [
"__version__",
Expand Down
10 changes: 8 additions & 2 deletions contrib/pyln-testing/pyln/testing/utils.py
Expand Up @@ -1435,8 +1435,8 @@ def get_nodes(self, num_nodes, opts=None):
return [j.result() for j in jobs]

def get_node(self, node_id=None, options=None, dbfile=None,
feerates=(15000, 11000, 7500, 3750), start=True,
wait_for_bitcoind_sync=True, may_fail=False,
bkpr_dbfile=None, feerates=(15000, 11000, 7500, 3750),
start=True, wait_for_bitcoind_sync=True, may_fail=False,
expect_fail=False, cleandir=True, **kwargs):
self.throttler.wait()
node_id = self.get_node_id() if not node_id else node_id
Expand Down Expand Up @@ -1470,6 +1470,12 @@ def get_node(self, node_id=None, options=None, dbfile=None,
with lzma.open(os.path.join('tests/data', dbfile), 'rb') as f:
out.write(f.read())

if bkpr_dbfile:
out = open(os.path.join(node.daemon.lightning_dir, TEST_NETWORK,
'accounts.sqlite3'), 'xb')
with lzma.open(os.path.join('tests/data', bkpr_dbfile), 'rb') as f:
out.write(f.read())

if start:
try:
node.start(wait_for_bitcoind_sync)
Expand Down