gossipd: make gossip loading stats accurate.

They didn't count the header sizes when reporting bytes, which is
misleading.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-04-10 17:01:29 +09:30 committed by neil saitug
parent eb4564c3cd
commit ec50ec6a71
2 changed files with 2 additions and 2 deletions

View File

@ -363,7 +363,7 @@ void gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)
bad = "Unknown message";
goto truncate;
}
known_good += sizeof(belen) + msglen;
known_good += sizeof(belen) + sizeof(becsum) + msglen;
gs->count++;
tal_free(msg);
}

View File

@ -879,7 +879,7 @@ def test_gossip_store_load(node_factory):
l1.start()
# May preceed the Started msg waited for in 'start'.
wait_for(lambda: l1.daemon.is_in_log('gossip_store: Read 1/1/1/0 cannounce/cupdate/nannounce/cdelete from store in 744 bytes'))
wait_for(lambda: l1.daemon.is_in_log('gossip_store: Read 1/1/1/0 cannounce/cupdate/nannounce/cdelete from store in 756 bytes'))
assert not l1.daemon.is_in_log('gossip_store.*truncating')