Rusty Russell
5e7b3d02a1
daemon: batching of changes as per BOLT #2 .
We now keep a list of commitment transaction states for "us" and
"them", as well as a "struct channel_state" for staged changes.
We manipulate these structures as we send out packets, receive
packets, or receive acknowledgement of packets. In particular, we
update the other nodes' staging_cstate as we send out our requests,
and update our own staging_cstate are we receive acks. When we
receive a request, we update both (as we immediately send out our
ack).
The RPC output is changed; rather than expose the complexity, we
expose our last committed state: what would happen if we have to drop
to the blockchain now.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
71c02c7b4c
daemon: make json_get_param() understand which args are compulsory.
So far only one isn't, so this saves us some checks.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
168ed96b12
daemon: close command.
This performs a mutual close.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
f690be1e83
daemon: dev-crash command.
Causes us to dump in crash.log.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
a3e3f83d9f
daemon: dev-mocktime command
Useful for precise timing control for testing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
2346f6bf14
daemon: routefail command.
This should be renamed: it's actually any kind of after-the-fact failure.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
1e82799852
daemon: fulfillhtlc command
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
6bdaa5d1ca
daemon: newhtlc command.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
5acb3c9848
daemon: dev-rhash command.
Useful for creating SHA256(r) from scripts.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
fc49e3fd74
daemon: rename 'state' to 'dstate' everywhere.
This is the daemon state, not the state machine state.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
08ccb4b6f0
getpeers: new command.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
d68ae0b612
jsonrpc: adapt it to be async.
This allows for JSON commands which aren't instantaneous.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
2df28021ac
daemon: command to connect
Now we can connect two daemons to each other. Who both say Hello! and
close.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
9ccb51c93f
daemon: UNIX domain socket for JSON-based control.
Also taken from pettycoin.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago