forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
locktime.h
26 lines (21 loc) · 841 Bytes
/
locktime.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef LIGHTNING_BITCOIN_LOCKTIME_H
#define LIGHTNING_BITCOIN_LOCKTIME_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <stdbool.h>
/* As used by nSequence and OP_CHECKSEQUENCEVERIFY (BIP68) */
struct rel_locktime {
u32 locktime;
};
bool rel_locktime_is_seconds(const struct rel_locktime *rel);
u32 rel_locktime_to_seconds(const struct rel_locktime *rel);
u32 rel_locktime_to_blocks(const struct rel_locktime *rel);
/* As used by nLocktime and OP_CHECKLOCKTIMEVERIFY (BIP65) */
struct abs_locktime {
u32 locktime;
};
bool blocks_to_abs_locktime(u32 blocks, struct abs_locktime *abs);
bool abs_locktime_is_seconds(const struct abs_locktime *abs);
u32 abs_locktime_to_seconds(const struct abs_locktime *abs);
u32 abs_locktime_to_blocks(const struct abs_locktime *abs);
#endif /* LIGHTNING_BITCOIN_LOCKTIME_H */