mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
28 lines
901 B
C
28 lines
901 B
C
|
#ifndef LIGHTNING_BITCOIN_LOCKTIME_H
|
||
|
#define LIGHTNING_BITCOIN_LOCKTIME_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 seconds_to_rel_locktime(u32 seconds, struct rel_locktime *rel);
|
||
|
bool blocks_to_rel_locktime(u32 blocks, struct rel_locktime *rel);
|
||
|
bool rel_locktime_is_seconds(const struct rel_locktime *rel);
|
||
|
u32 rel_locktime_to_seconds(const struct rel_locktime *rel);
|
||
|
|
||
|
u32 bitcoin_nsequence(const struct rel_locktime *rel);
|
||
|
|
||
|
/* As used by nLocktime and OP_CHECKLOCKTIMEVERIFY (BIP65) */
|
||
|
struct abs_locktime {
|
||
|
u32 locktime;
|
||
|
};
|
||
|
|
||
|
bool seconds_to_abs_locktime(u32 seconds, struct abs_locktime *abs);
|
||
|
bool blocks_to_abs_locktime(u32 blocks, struct abs_locktime *abs);
|
||
|
bool abs_locktime_is_seconds(const struct abs_locktime *abs);
|
||
|
|
||
|
#endif /* LIGHTNING_BITCOIN_LOCKTIME_H */
|