Implement haandling of PROTOCOL_RESP_NEW_TRANSACTION.

Not much to do, but don't treat their ack as an error!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Query for batch when a block is sent.

Now need to code response.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Update incorrect debug log message.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
batch_max: helper for how much should be in batch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Add enum debug printing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Handling of complete batches from one peer to another.

Unfortunately, keeps asking for same batch if you don't have it.
Get smarter!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
generating: reap properly (requires latest ccan/io).

We were doing io_close_other(), but that doesn't happen immediately.
This means we were waiting for the generator to exit, leading to large
latencies.

With ccan/io changed so that finish is called after the fd is closed,
we can safely do the wait here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Two important FIXMEs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Generalize inject test program.

Have it spit out txid so we can use that to create further transactions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Test code to inject normal transactions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Split off type logging and use in injection for errors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
PROTOCOL_ERROR_TRANS_BADSIG => PROTOCOL_ERROR_TRANS_BAD_SIG

Underscores everywhere else.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
First implementation of normal transactions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rename check_transaction to check_transaction_proof()

check_transaction is now a generic helper.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
inject: fix usage comment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Extra check for pending transactions after new block.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Update for ccan/io changes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fix loading blocks from disk.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fix loading actual transactions from disk (not just blocks).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
generator: clean up code.

The idea of closing stdin to stop the generator was always racy; just use SIGUSR1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>