peer: fix ownership of connection.

pettycoin: packet_io.c:22: add_log_for_fd: Assertion `fd_to_log[fd] == ((void *)0)' failed.

This is because the connection doesn't own the peer, so it doesn't get
freed when the conn is.  The destructor (destroy_peer) is responsible for
removing the fd from packet_io.c.

Since we moved to the new ccan/io (81294e06bd31c09d03f7e6870846c08055f3120a)
we want to keep the peer connected to the conn: a nice side-effect of the
simplified io_duplex.

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

Fascinating bug when the two seed nodes diverged by several thousand blocks
(due to I/O loss, judging from the logs).

When a new block was generated by the remote node, it sends it to us.
We don't know the ->prev_block, so we forget the block, and ask for ->prev_block.
It sends us that block, but again, we don't know prev...

While we're chasing back several thousand blocks, it generates a new block,
and we start chasing prevs for that as well.  Which slows us down more.

Resolving the FIXME and remembering detached blocks should fix this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
spv-blocks.c to measure how many old blocks we'd have to keep.

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