Keep track of what transactions to broadcast to peers.

When a new block comes in, we might need to remove some of them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Don't differentiate gateway from normal transaction at net protocol level.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
First cut of transmitting transactions to peers.

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

This helps track multiple clients logging to same screen.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
peer: explicitly avoid sending transaction back to peer who sent to us.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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>