tx_len: length function for transactions (replacing marshal_tx_len)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tx.c: out-of-line most tx functions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
test: add named_blocks common helper.

This is reproduced in many test files; unify it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: make update-mocks work on clean tree.

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

We want to know if memory is undefined earlier, so use explicit calls.
That includes in the packet sending path, as well as the hash functions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
shadouble helpers: use valgrind helpers.

This makes tracking bugs easier.  I added helpers for doing a double-SHA256
all at once, but don't use it everywhere else to avoid churn.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
packet_io: valgrind check outgoing packets.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
log: use valgrind helpers on structures.

Another chance to catch uninitialized structure elements.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
todo: zero another unused field.

Switch to using a specific helper for this, as the
PROTOCOL_PKT_GET_TX_IN_BLOCK is a u8, not a u16, so the previous unused
pointer method doesn't work.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
blockfile: don't do complete chain check if running under valgrind.

With any significant number of blocks, it takes far too long.

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