Rusty Russell
04b3e8f91d
daemon: use siphash for hashes.
Remove ccan/hash (aka Jenkins lookup3) altogether.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
d1416ea5b5
TAGS: don't go into git dirs.
Things get quite confusing when this happens.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
ocinq
bcdab60694
Makefile : ccan/asort is referenced
Added explicit compilation and linking of ccan/asort as needed by daemon/chaintopology
9 years ago
Rusty Russell
49ebed737d
daemon/test: test differential fees.
This would have revealed the previous breakage (and I tested that!),
plus now we test negotiate on closing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
9bb070f5b6
0.3 release: Braydon Fuller: Nakamoto's Genesis Coins
Braydon wrote the INSTALL.md file; he gets to name this release,
in line with the theme.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
97bc4ed0cb
daemon/test: test mutual close with outstanding HTLCS.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
f43cc72d6a
Makefile: add generated packet names.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
e46a2ed49a
test/test_protocol: rename internally to match updated 02-wire-protocol.md
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
06d2c19c41
test/test_protocol: make pretty(-ish) SVG diagrams.
Could make them much prettier, but they're functional.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
c710a64ccf
Makefile: support for suppressing valgrind.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
7f90d183da
test/test_protocol: simulator for the updated wire-protocol BOLT.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
35d1b13cde
daemon: commit outstanding changes via timer.
While useful for testing, it doesn't make sense to have an explicit commit
command; we should commit whenever there are outstanding changes.
We have a 10ms timer to allow limited batching, however.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
4beaedfa49
daemon/test: clean up Makefile.
This means mkae tells us directly what failed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
d6603adc2f
daemon/test: test stealing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
623eec4068
daemon/test: test unilateral close.
We use dev-disconnect to convince one node the other has disconnected
(but not vice versa), to get deterministic behaviour. We do this with
one HTLC outstanding, to test the HTLC timeout path.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
f29a6043d2
daemon: open-code handling of on-chain states.
Once we see an on-chain tx, we ignore the state machine and handle it
as per the onchain.md draft. This specifies a *resolution* for each
output, and we're done when they're irrevocable.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
3f374d8d8b
check-bolt: handle references to early-drafts too.
Particularly for the onchain.md draft.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
9eabab78ab
utils: tal_hexstr() helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
a150bd191a
remove_dust: don't ever create dust outputs.
This behavior will be specified in BOLT #3 .
Closes : #14
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
4bbb86ae30
daemon: clean up test dirs.
Move final helpers out of test-cli/
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
03a538ca02
check-bolt: check that comments in code match the specs.
And fix the mistakes!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
5ba7692254
Makefile: fix config.h rebuilds in parallel.
Occasionally make seems to rebuild this in parallel, so make sure to
never have a partially complete one.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
e7b9a913a6
bitcoind: getrawblock helper.
It turns out using the verbose=false parameter, you can get the raw block
from getblock. Do that.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
410fc3b272
misc: remove some unused functions.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
6b956ea22a
varint: new file.
Move varint handling from tx.c and generalize it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
ed70b13041
bitcoin: add first unit test.
Should grow from here.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
f8796c261b
Make BIP68 and CSV support the default.
This has gone upstream into bitcoind, so enable it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
8104886503
Remove Alpha support.
I had already disabled it, and this clears the decks for Segregated Witness
which gives us everything we want.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
18a9e5bda2
daemon: Implement encryption as per BOLT #1 .
This uses libsodium (we could use openssl, but the required primitives
are only in 1.1.0 which is still in alpha).
It doesn't handle reconnections yet, either.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
64e5ce1530
test: remove test_state_coverage
We're going to change the protocol to send multiple changes at once, so
disable this compilation and testing for now.
We can revisit it afterwards once the protocol is stable again.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
09358498cd
Remove test-cli
We're about to change the protocol again, and I don't want to do the
grunt work to update these. They were useful for pre-build protocol
testing, though.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
b280cab6b0
Makefile: clean daemon files with make clean.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Braydon Fuller
e0c4d40899
doc: add install notes
9 years ago
Rusty Russell
6750794667
Use #if instead of #ifdef (we already use -Wundef).
This avoids embarassing typos in future.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
1e93da5513
Really enable checklocktimeverify support.
Next patch will make sure this never happens again.
Fixes : #18
Reported-by: Fabrice
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
d3455e7c22
Add brief HACKING.md, and update name.
Each release gets names by a new contributor: this one thanks to
Anthony Towns!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
b70c18a40e
daemon: implement anchor watch timeout.
We abort when this happens, but still worth testing.
This involves a refactor so we can allocate watches off a specific context,
for easy freeing when they're no longer wanted.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
f5538bd1d2
daemon: test scripts.
We comment out the peer_create_close_tx() abort for now, so we
can test.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
378dadc371
daemon: configuration directory (default ~/.lightning).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
117cf6b02d
daemon: add logging options.
Particularly logging to file.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
3e77c55a3b
Makefile: add daemon source sanity checks.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
dd35260ce8
daemon: first code.
Logging code based heavily on pettycoin's.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
caa27f1d93
names.h/names.c: wrappers to get name for states/inputs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
e6dfff3ba8
licensing: Make license explicit.
Note that we're BSD-MIT but some of the ccan modules are different
licenses.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
3a803eefbb
bitcoin/tx: move bitcoin_tx_from_file() to test-cli, expose bitcoin_tx_from_hex()
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
888389e625
ccan: update and add more.
We need the following additional modules for the daemon:
io, time, timer, pipecmd
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
906a5e4a32
Move pkt.c into test-cli.
We use cryptopkt for normal cases.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
a38d0c985e
Makefile: more fascist warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
4163935bbb
ccan: import time module.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
e97e8988f8
ccan: import isaac and dependencies.
We could probably just use Openssl's RAND_pseudo_bytes, but this gives
a nice interface to get a number between 1 and N.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago