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
Christian Decker
aba3d5f34d
wallet: Clean up spent UTXOs once they are buried deeply enough
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
8958a082ec
wallet: Mark utxo outpoints as spent
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
50a8e32e3f
db: Add index on utxoset.spendheight to speed up blockchain reorgs
Otherwise we would be doing a table scan per block being reorged/rescanned.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
27e0ec694c
wallet: Add primitive to register new utxoset outpoint to the wallet
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
d8d11e5689
wallet: Add outpointfilter for the utxoset
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
ec014be2a8
db: Add utxoset table
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
5a1b4b91e2
wallet: Fix output extraction when we own multiple outputs
When we already know about an output we would stop scanning the remaining
outputs. Known outputs happen whenever we extracted from our own transactions
and then extracted again from blocks. We would not update if the first update
fails.
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
b3c94a5256
wallet: Update existing owned outputs with their confirmation height
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
7fc06d9b3e
wallet: Add outpointfilter to wallet so we can pass it all outputs
Will be used later to filter out outputs we are interested in, and
trigger db updates with them.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
247aa13a58
db: Add index covering the output heights
Avoids performing a table scan, now deletes on blocks are a lot
faster.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
4e2c1dd038
jsonrpc: Add confirmation status to `listfunds` output
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
7f00230657
db: Add confirmation_height and spend_height columns to outputs
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
9440b23852
wallet: Add primitive to roll back to a specific height
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
504202973f
wallet: Add primitives to store blockchain internally
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
fea03dbca9
db: Add a table to track blockheaders
Signed-off-by: Christian Decker <decker.christian@gmail.com>
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
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
Igor Cota
3371168d54
Add bolt11 to the invoice struct.
We store this in case an RPC client asks for it
7 years ago
Igor Cota
2bb9797ddb
Add bolt11 to the invoices db table as TEXT.
Saving in case an RPC client needs it later
7 years ago
ZmnSCPxj
efc5da9ad4
invoices: Use common code for loading r and rhash.
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
e9112af0bc
invoices: Move expiration timer to invoices object.
In preparation for removing in-memory invoices objects.
7 years ago
ZmnSCPxj
7a6fe0704e
invoices: Unify waitone/any waiters to invoices object.
In preparation for removing in-memory invoice objects.
Since they will be removed, there will no longer be any
individual invoice objects to attach to.
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
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
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
Christian Decker
7c8883ae7d
wallet: Fix an off by one error in dev-listaddrs
Reported-By: @Xian001
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Rusty Russell
cccdb53bec
channel_states: fold all the ONCHAIND states into one.
The billboard is now far more useful to tell what's going on, and this
gets us closer to a state == owner mapping.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
86a04c59d4
lightningd: maintain a status billboard for each channel.
Each state (effectively, each daemon) has two slots: a permanent slot
if something permanent happens (usually, a failure), and a transient
slot which summarizes what's happening right now.
Uncommitted channels only have a transient slot, by their very nature.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
655ae90e5e
wallet: remove obsolete peers.
Fixes : #1029
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
practicalswift
d873bf60bf
Remove unused parameter fieldname in json_add_log(..., const char *fieldname, ...)
7 years ago
practicalswift
7be95cee94
Remove unused parameter ctx in wallet_peer_load(const tal_t *ctx, ...)
7 years ago
practicalswift
1f46262278
Remove unused parameter testname in create_test_db(const char *testname)
7 years ago
practicalswift
91a9c2923f
Mark intentionally unused parameters as such (with "UNUSED")
7 years ago
Rusty Russell
e92b710406
tools/generate-wire.py: remove length argument from fromwire_ routines.
We always hand in "NULL" (which means use tal_len on the msg), except
for two places which do that manually for no good reason.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
719290a4c4
txwatch: remove unused callback arg, hide struct definitions.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
ae8fb96d06
lightningd/channel_control: routines to control channeld (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
372040bbd5
lightningd/onchain_control: routines to control onchaind (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
9176ee628c
lightningd/closing_control: routines to control closingd (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
a83ff83328
lightningd/connect_control: routines to control connecting (move from peer_control.c)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
4cf274b1c0
lightningd/opening_control: routines to control openingd (move from peer_control.c)
We also fold opening_got_hsm_funding_sig() into the caller; it was
previously a callback before we decided to always use the HSM
synchronously.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago