Browse Source
Also fix open-channel usage message. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>ppa-0.6.1
Rusty Russell
10 years ago
4 changed files with 32 additions and 20 deletions
@ -0,0 +1,20 @@ |
|||
#include "opt_bits.h" |
|||
|
|||
char *opt_set_bits(const char *arg, u64 *satoshi) |
|||
{ |
|||
unsigned long long ll; |
|||
char *ret = opt_set_ulonglongval_si(arg, &ll); |
|||
if (ret) |
|||
return ret; |
|||
*satoshi = ll * 100; |
|||
if (*satoshi / 100 != ll) |
|||
return "Invalid number of bits"; |
|||
return NULL; |
|||
} |
|||
|
|||
void opt_show_bits(char buf[OPT_SHOW_LEN], const u64 *bits) |
|||
{ |
|||
unsigned long long ll = *bits / 100; |
|||
opt_show_ulonglongval_si(buf, &ll); |
|||
} |
|||
|
@ -0,0 +1,9 @@ |
|||
#ifndef LIGHTNING_OPT_BITS_H |
|||
#define LIGHTNING_OPT_BITS_H |
|||
#include <ccan/opt/opt.h> |
|||
#include <ccan/short_types/short_types.h> |
|||
|
|||
char *opt_set_bits(const char *arg, u64 *satoshi); |
|||
void opt_show_bits(char buf[OPT_SHOW_LEN], const u64 *bits); |
|||
|
|||
#endif /* LIGHTNING_OPT_BITS_H */ |
Loading…
Reference in new issue