mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
peer: always initialize commit_info commit number, other fields.
We used to use talz, but that prevents valgrind from noticing when we use uninitialized fields. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
4
state.c
4
state.c
@@ -28,7 +28,7 @@ static void send_open_pkt(struct peer *peer,
|
||||
{
|
||||
/* Set up out commit info now: rest gets done in setup_first_commit
|
||||
* once anchor is established. */
|
||||
peer->local.commit = new_commit_info(peer);
|
||||
peer->local.commit = new_commit_info(peer, 0);
|
||||
peer->local.commit->revocation_hash = peer->local.next_revocation_hash;
|
||||
peer_get_revocation_hash(peer, 1, &peer->local.next_revocation_hash);
|
||||
|
||||
@@ -37,7 +37,7 @@ static void send_open_pkt(struct peer *peer,
|
||||
|
||||
static Pkt *init_from_pkt_open(struct peer *peer, const Pkt *pkt)
|
||||
{
|
||||
struct commit_info *ci = new_commit_info(peer);
|
||||
struct commit_info *ci = new_commit_info(peer, 0);
|
||||
Pkt *err;
|
||||
|
||||
err = accept_pkt_open(peer, pkt, &ci->revocation_hash,
|
||||
|
||||
Reference in New Issue
Block a user