Skip to content
Open
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: 1 addition & 1 deletion plugins/spender/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static struct command_result *do_fail(struct command *cmd,
"splice_error(psbt:%p, splice_cmd:%p, str: %s)",
splice_cmd->psbt, splice_cmd, str ?: "");

abort_pkg = tal(cmd->plugin, struct abort_pkg);
abort_pkg = tal(cmd, struct abort_pkg);
abort_pkg->splice_cmd = tal_steal(abort_pkg, splice_cmd);
abort_pkg->str = tal_strdup(abort_pkg, str);
abort_pkg->code = code;
Expand Down
15 changes: 14 additions & 1 deletion tests/test_splice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fixtures import * # noqa: F401,F403
from pathlib import Path
from pyln.client import Millisatoshi
from pyln.client import RpcError, Millisatoshi
import pytest
import re
import unittest
Expand Down Expand Up @@ -716,3 +716,16 @@ def test_easy_splice_out_into_channel(node_factory, bitcoind, chainparams):

end_chan1_balance = Millisatoshi(bkpr_account_balance(l2, chan1))
assert initial_chan1_balance + Millisatoshi(spliceamt * 1000) == end_chan1_balance


@pytest.mark.openchannel('v1')
@pytest.mark.openchannel('v2')
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
def test_spliceout_exceeds_channel_balance(node_factory):
"""Test splicing out more than the channel balance fails"""
l1, l2 = node_factory.line_graph(2, fundamount=1000000, wait_for_announce=True,
opts={'experimental-splicing': None})
with pytest.raises(RpcError):
l1.rpc.spliceout("*:?", "99999999") # way more than channel holds
p1 = only_one(l1.rpc.listpeerchannels(peer_id=l2.info['id'])['channels'])
assert 'inflight' not in p1
Loading