Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightning-cli txprepare with a particular syntax provokes FATAL SIGNAL 11 #3533

Closed
gabridome opened this issue Feb 17, 2020 · 4 comments · Fixed by #3534
Closed

lightning-cli txprepare with a particular syntax provokes FATAL SIGNAL 11 #3533

gabridome opened this issue Feb 17, 2020 · 4 comments · Fixed by #3534

Comments

@gabridome
Copy link
Contributor

Issue and Steps to Reproduce

Trying to make lightning-cli txprepare work, I attempted also the following syntax:

lightning-cli txprepare "[{\"bc1hfsk...\":\"all\"}]" slow 1 "[\"e2er...:1\"]"

The output was:

lightning-cli: reading response: socket closed

The log said:

2020-02-17T11:57:17.157Z **BROKEN** lightningd: FATAL SIGNAL 11 (version v0.8.0)
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: common/daemon.c:46 (send_backtrace) 0x557033ce5da1
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: common/daemon.c:54 (crashdump) 0x557033ce5dde
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7ff67d1c405f
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: common/wallet_tx.c:208 (wtx_from_utxos) 0x557033ceebe5
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: wallet/walletrpc.c:374 (json_prepare_tx) 0x557033d16e1a
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: wallet/walletrpc.c:415 (json_txprepare) 0x557033d1775d
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: lightningd/jsonrpc.c:588 (command_exec) 0x557033cc4a51
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: lightningd/jsonrpc.c:679 (rpc_command_hook_callback) 0x557033cc6106
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: lightningd/plugin_hook.c:123 (plugin_hook_call_) 0x557033cde6dc
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: lightningd/jsonrpc.c:729 (plugin_hook_call_rpc_command) 0x557033cc5039
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: lightningd/jsonrpc.c:736 (call_rpc_command_hook) 0x557033cc5039
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: common/timeout.c:39 (timer_expired) 0x557033cedd4e
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: lightningd/io_loop_with_timers.c:32 (io_loop_with_timers) 0x557033cc3217
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: lightningd/lightningd.c:855 (main) 0x557033cc76a6
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x7ff67d1b12e0
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0x557033cb5939
2020-02-17T11:57:17.157Z **BROKEN** lightningd: backtrace: (null):0 ((null)) 0xffffffffffffffff

"version": "v0.8.0"

May I also have an example of which syntax should work?

@darosior
Copy link
Collaborator

Was the utxo you passed confirmed ? I'm trying to reproduce this with 0.8.1

@darosior
Copy link
Collaborator

darosior commented Feb 17, 2020

Ok looks like it was an unconfirmed utxo, repro test for 0.8 (EDIT: And 0.8.1):

diff --git a/tests/test_wallet.py b/tests/test_wallet.py
index 01f496894..f2044422a 100644
--- a/tests/test_wallet.py
+++ b/tests/test_wallet.py
@@ -348,11 +348,17 @@ def test_txprepare(node_factory, bitcoind, chainparams):
     l1.rpc.txdiscard(prep4['txid'])
 
     # Try passing in a utxo set
-    utxos = [utxo["txid"] + ":" + str(utxo["output"]) for utxo in l1.rpc.listfunds()["outputs"]][:4]
-
+    utxos = [utxo["txid"] + ":" + str(utxo["output"])
+             for utxo in l1.rpc.listfunds()["outputs"]][:4]
     prep5 = l1.rpc.txprepare([{addr:
                              Millisatoshi(amount * 3.5 * 1000)}], utxos=utxos)
 
+    # Try passing unconfirmed utxos
+    unconfirmed_utxo = l1.rpc.withdraw(l1.rpc.newaddr()["bech32"], 10**5)
+    utxos = [unconfirmed_utxo["txid"] + ":0"]
+    prepx = l1.rpc.txprepare([{addr:
+                             Millisatoshi(amount * 3.5 * 1000)}], utxos=utxos)

@darosior
Copy link
Collaborator

May I also have an example of which syntax should work?

txprepare doesn't accept unconfirmed utxos.

@gabridome
Copy link
Contributor Author

RRRight!!! and, at the same time, I had the information I was looking for because in the meanwhile, the tx was confirmed.

So the right format is:

lightning-cli txprepare "[{\"destinationaddress...\":\"all\"}]" slow 1 "[\"txid...:1\"]"

It could be of some help have a mention of the right format as an example in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants