mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
common/gossip_store: fix lseek argument order on gossip_store reload.
We don't currently use this, but it's badly wrong. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
2b7e5f7f5a
commit
247fb6fa6a
@@ -147,10 +147,10 @@ u8 *gossip_store_next(const tal_t *ctx, struct per_peer_state *pps)
|
|||||||
void gossip_store_switch_fd(struct per_peer_state *pps,
|
void gossip_store_switch_fd(struct per_peer_state *pps,
|
||||||
int newfd, u64 offset_shorter)
|
int newfd, u64 offset_shorter)
|
||||||
{
|
{
|
||||||
u64 cur = lseek(pps->gossip_store_fd, SEEK_CUR, 0);
|
u64 cur = lseek(pps->gossip_store_fd, 0, SEEK_CUR);
|
||||||
|
|
||||||
/* If we're already at end (common), we know where to go in new one. */
|
/* If we're already at end (common), we know where to go in new one. */
|
||||||
if (cur == lseek(pps->gossip_store_fd, SEEK_END, 0)) {
|
if (cur == lseek(pps->gossip_store_fd, 0, SEEK_END)) {
|
||||||
status_debug("gossip_store at end, new fd moved to %"PRIu64,
|
status_debug("gossip_store at end, new fd moved to %"PRIu64,
|
||||||
cur - offset_shorter);
|
cur - offset_shorter);
|
||||||
assert(cur > offset_shorter);
|
assert(cur > offset_shorter);
|
||||||
|
|||||||
Reference in New Issue
Block a user