Rusty Russell
36746bf65a
Makefile: make gossipd objects depend correctly on its own headers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
bcfbc24308
gossipd: split peer structure to clearly separate local and remote fields.
We should also go through and use consistent nomenclature on functions which
are used with a local peer ("lpeer_xxx"?) and those with a remote peer
("rpeer_xxx"?) but this is minimal.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
0cab9d1dd1
daemon_conn: helper to release daemon_conn.
We'll want this for the next change, where gossipd migrates remote peers
back to local ones.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
8ed511b3c7
test_lightningd: add test for funding failures.
We should not disconnect from a peer just because it fails opening; we
should return it to gossipd, and give a meaningful error.
Closes : #401
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
97434d9c4a
openingd: handle ERROR packets (if other end fails negotiation).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
6b232de7b1
openingd: return to master for more gossip when negotiation fails.
We can open other channels, if we want.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
afea2520ba
wireaddr: marshal empty address properly.
On unmarshal, we stop unmarshaling on a 0 (ADDR_TYPE_PADDING) type. So
we should also stop marshaling in that case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
899bf3fde9
subd: add transaction to subd exit corner case.
As demonstrated in the test at the end of this series, openingd dying
spontaneously causes the conn to be freed which causes the subd to be
destroyed, which fails the peer, which hits the db.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
20d7ddcb6e
json_fund_channel: give more details than "peer died".
Rather than using the destructor, hook up the cmd so we can close it.
peers are allocated off ld, so they are only destroyed explicitly.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Christian Decker
a0724f45af
routing: Do not set an empty channel_announcement if none is given
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
4a51de44c0
gossip: Forward when we don't have a valid node_announcement yet
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
580a2612fd
routing: Add local and sigfail to trace when receiving cannounce
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
ba45ccffd8
routing: Return boolean from handle_channel_announcement
This will later be used to determine whether or not we should announce
ourselves as a node.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
b5f737e563
gossip: Passing alias, color and wireaddrs through to gossipd
First step towards `gossipd` managing the `node_announcement`.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
67c6d4d1f1
opts: Change alias to be u8*, better matches the unicode nature
We are still generating only char* style aliases, but the field is
defined to be unicode, which doesn't mix too well with char.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
19c030ea1f
routing: Make routing_state aware of its own ID
This is used to identify our own announcements.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
8d6281175d
gossip: Remove HSM_FD from handshake
7 years ago
ZmnSCPxj
4022fc0034
wallet.c: Minor leak in wallet_invoices_load.
7 years ago
ZmnSCPxj
44c37b60e4
Add test for withdrawing to P2WPKH and P2WSH.
7 years ago
ZmnSCPxj
e26d294b60
Add support for withdrawing to BECH32 addresses.
Fixes : #428
7 years ago
ZmnSCPxj
8512e2c8ef
README.md: Add link to waitanyinvoice
7 years ago
Rusty Russell
bbbbb60863
wallet: don't leak string on update.
We actually don't need tal_fmt() here at all, anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
5a319c781c
wallet: don't leak UTXO array on extracting outputs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
9747d1a62c
database: don't leak query string.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
65fd7ce132
bitcoind: don't leak memory on every call to bitcoin-cli.
Fixes : #412
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
b00525b8c8
options: don't leak memory when people override options.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
005f3826c9
wallet/tests: add mocks for futureproofing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
2931760b5b
wallet: move tests into test/ dir like other unit tests.
Trivial move, but makes it easy to add new ones.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
ZmnSCPxj
757d45c8a3
Test withdrawal to P2SH address.
7 years ago
ZmnSCPxj
9842898ca4
Add support for withdrawing to P2SH addresses.
7 years ago
ZmnSCPxj
d43fb87871
Factor out scriptpubkey_from_address function from json_withdraw.
7 years ago
ZmnSCPxj
9f481226fa
Rearrange checking of withdrawal address parsing success in json_withdraw.
7 years ago
ZmnSCPxj
b56fea8b2a
Modify hsm_sign_withdrawal to transmit scriptpubkey to withdraw to, rather than pkh.
7 years ago
ZmnSCPxj
5fd74f9933
Change withdraw_tx to accept scriptpubkey rather than plain address.
7 years ago
Rusty Russell
0610f66c34
bolt11: handle r value fee spec change.
We don't use it yet, but now we'll decode correctly.
See: https://github.com/lightningnetwork/lightning-rfc/pull/317
lightning-rfc commit: ef053c09431442697ab46e83f9d3f86e3510a18e
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Rusty Russell
e9f9721ed3
devtools/bolt11-cli: handle hashed descriptions
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
Christian Decker
34444a99f9
docker: Added clang to build dependencies
7 years ago
Christian Decker
7572c22a26
travis: Add clang build to build matrix
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
Christian Decker
61852b4603
cleanup: Use check_act* in handshake and remove unused static inline
This was tripping up `clang`.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
7 years ago
practicalswift
486d321094
Avoid NULL pointer dereference in channelseq(...)
7 years ago
practicalswift
4452e3f3f1
Remove redundant code
7 years ago
practicalswift
0353ec0983
Remove trailing whitespace
7 years ago
ZmnSCPxj
7c09b6f478
Load defaults for purpose of help.
7 years ago
ZmnSCPxj
f0fa01b439
Share similar code between bitcoin_witness_p2sh_p2wpkh and bitcoin_scriptsig_p2sh_p2wpkh.
Note that bitcoin_witness_p2sh_p2wpkh is not actually used in current
code.
7 years ago
practicalswift
307e8c0180
Avoid NULL pointer dereference when new_initial_channel(...) fails
7 years ago
ZmnSCPxj
38fc280fad
Make json_withdraw check testnet flag.
bitcoin_from_base58 returns a testnet flag, but json_withdraw
did not actually check it. Add a basic check that the given
withdraw address belongs to the same net lightningd is using.
7 years ago
practicalswift
2ed53025f9
Remove redundant remote_shutdown_scriptpubkey assignment
7 years ago
practicalswift
b5c8b9b9b3
Add build artefacts generated during "make"/"make check" to .gitignore
7 years ago
practicalswift
61c47c09d0
Fix typos
7 years ago
Rusty Russell
5444084625
onchaind: fix reversed CSV delays.
Our config -> their CSV delay, their config -> our CSV delay.
Fixes : #395
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago