Christian Decker
cb4ba9bf4f
gossip: Use the utxoset to shortcircuit the txout lookup
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
ZmnSCPxj
1de124277b
peer_control: Print both `to_self_delay` in listpeers.
7 years ago
John Barboza
b4f7ce61b4
Append to crash log instead of creating new one
Multiple crashes accumulate in case you have some kind
of auto-restart for daemons.
7 years ago
Isidoro Ghezzi
f24a7b9356
help: listnodes and listchannels,have optional arg
7 years ago
practicalswift
161ed320f8
Improve onboarding experience by handling common failure scenarios for new users more gracefully
Improve usability in these scenarios:
* bitcoin-cli not available in PATH and/or bitcoind not running
* bitcoin-cli available in PATH but bitcoind is not running
7 years ago
Rusty Russell
6c1233de44
channel: reserve a bip32 index as soon as channel is opened.
This simplifies things, and means it's always in the database. Our
previous approach to creating it on the fly had holes when it was
created for onchaind, causing us to use another every time we
restarted.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
e76f863329
txfilter: clean up prototypes.
Use const, add TAKES to declaration.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
c9e271df90
pay: wrap missing route_channels handling in COMPAT_V052.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
9d9c1c3db6
wallet: wrap missing last_processed_block handling in COMPAT_V052.
Our testing also reveals a bug: we start lightningd and shut it down
before fully processing the blockchain, so we don't set
last_processed_block. Fix that by setting it immediately once we have
a block: worst case it goes backwards a little.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
5d5c1a5da5
lightningd: don't discard const in get_chainparams().
In general, it is true that accessors should take const and discard it,
but chainparams is *always* const.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
John Barboza
30b290cb8f
Explicit error message when disconnect fails
Whether the peer is not connected or not gossiping.
7 years ago
John Barboza
0a1351fd51
gossipd: command to disconnect from a gossiping peer
lightning-cli disconnect <peer id>
7 years ago
Corné Plooy
b2ce619bcd
Fix order of includes
7 years ago
Corné Plooy
71c39e96f3
Instead of passing the line number behind the '\0' of an artificial command-line argument, store it in a global variable.
While it is still a bit of a hack, this makes the code much easier to read.
7 years ago
Corné Plooy
b857b2e843
Add assertions in various places to ensure tal_fmt doesn't receive NULL as argument for strings.
7 years ago
Christian Decker
e44ea0b363
topology: Add new P2WSH outpoints to the wallet utxoset
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
ae30942e3f
chaintopo: Record outpoint spends for owned outputs
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
2680e6d9ff
wallet: Move txfilter into wallet
Transaction filters are strongly related to the wallet, this move just
makes it a bit more explicit.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
5fd19483a9
txfilter: Add an outpoint filter
This can be used both for our own outputs as well as the utxos we are
tracking.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
227dc36146
utxo: Add blockheight and spendheight to outputs to track state
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
1aa21498c3
topology: Track blockchain changes in the DB
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
ZmnSCPxj
8e8d7c2aba
pay/sendpay: Use spec names for rhash and r.
7 years ago
John Barboza
31b9b6bc1c
clear onchaind subd in channel on error
When the subdaemon closes unexpectedly, clear the reference and
update the channel billboard with the description
7 years ago
ZmnSCPxj
1f6008689d
payalgo: Throttle pay command if failure is due to blockheight disagreement.
7 years ago
John Barboza
b50912d8b1
Print node alias when listing peers
7 years ago
Rusty Russell
c5d41a23d7
short_channel_id: just use structeq.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
042d5d13f5
short_channel_id: don't use bitfields.
I leave all the now-unnecessary accessors in place to avoid churn, but
the use of bitfields has been more pain than help.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Igor Cota
cb6820d445
Do preimage, hash and consequentially bolt11 generation before we store the invoice in db.
This way we store bolt11 to the table as well, in case a client needs it later
7 years ago
Christian Decker
a90502d917
jsonrpc: Refuse to forget a channel with an open HTLC
... instead provide useful suggestions as to how to close it.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
aef5780f36
htlc: Extracted htlc detection from the channel destructor
Let's have a simple function that allows us to check whether a channel
still has an HTLC open.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Corné Plooy
f32ebb7dca
Indentation fix.
7 years ago
Corné Plooy
1e879de89e
json-rpc: connection_complete_ok and json_command_malformed should never receive NULL arguments. Pass "null" instead, where needed.
7 years ago
Corné Plooy
d86ad15b53
json-rpc: translate NULL into "null" instead of "(null)".
7 years ago
practicalswift
dbb7ea1e41
Adjust log level for logging disconnected RPC users ("Command failed after jcon close")
This is a follow-up to #1121
7 years ago
ZmnSCPxj
978e5c67d8
invoices: Remove persistent in-memory invoice structures.
7 years ago
ZmnSCPxj
f05c86618c
invoices: Change iteration interface to be more abstract.
7 years ago
ZmnSCPxj
9b4c6699f9
invoices: Semantically separate invoice details from invoice.
In preparation for removing in-memory invoice structures.
Invoice details are requested rarely anyway.
7 years ago
practicalswift
a20cf5463d
Adjust log level for logging disconnected RPC users ("Abandoning command" + "Command returned result after jcon close")
The following command can be used to trigger these messages:
```
$ timeout 0.01 cli/lightning-cli connect [insert-syntactically-valid-peer-id-here] 123.123.123.123 # where 123.123.123.123 is unreachable
```
7 years ago
ZmnSCPxj
73cda2f2ae
payalgo: Report route, and result of trying route.
7 years ago
ZmnSCPxj
21cfec816d
payalgo: Report number of tries on failure.
7 years ago
ZmnSCPxj
6c9d81ef42
payalgo: Remove reporting PAY_TRY_ANOTHER_ROUTE and PAY_UNPARSEABLE_ONION.
These error codes will cause `pay` to retry, so `pay` will never
actually report those error codes.
Those error codes will only get reported at the `sendpay` level.
7 years ago
Rusty Russell
b7ed5670d5
lightningd: close and reopen db across fork for daemonize
Fixes : #1092
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
cf3f19524e
gossip: formalize passing of siphash_seed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
ZmnSCPxj
f7f55edcdb
wireaddr: Do hostname resolution in parse_wireaddr.
Fixes : #834
7 years ago
ZmnSCPxj
bd07a91782
jsonrpc: Let Base58 '2..' address work on both regtest and testnet.
7 years ago
John Barboza
b028a0a439
invoice: add fallback address to invoice command
* Modifies invoice command to have the following format
invoice <msatoshi> <label> <desc> <?expiry> <?fallbackaddr>
* Adds support for Segwit bcrt1 addresses for withdraw
* Add test case for fallback address in invoice creation
* Create a common json_tok_address_scriptpubkey to be used
by invoice and withdraw commands.
7 years ago
ZmnSCPxj
d23650d2ed
Explain fuzz initial values.
7 years ago
ZmnSCPxj
2db6ff9186
gossip_control: Change defult fuzz of getroute to 75%.
7 years ago
ZmnSCPxj
6767434ea9
routing: Use siphash24 for route randomization
Primary idea by @rustyrussell
7 years ago
ZmnSCPxj
61d0b50c54
payalgo: Randomize paths as long as we respect maxfeepercent.
7 years ago