You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
982 B
42 lines
982 B
10 years ago
|
#include <ccan/crypto/shachain/shachain.h>
|
||
|
#include <ccan/short_types/short_types.h>
|
||
|
#include <ccan/tal/tal.h>
|
||
|
#include <ccan/opt/opt.h>
|
||
|
#include <ccan/str/hex/hex.h>
|
||
|
#include <ccan/err/err.h>
|
||
|
#include "lightning.pb-c.h"
|
||
|
#include "anchor.h"
|
||
10 years ago
|
#include "bitcoin/base58.h"
|
||
10 years ago
|
#include "pkt.h"
|
||
10 years ago
|
#include "bitcoin/script.h"
|
||
10 years ago
|
#include "permute_tx.h"
|
||
10 years ago
|
#include "bitcoin/signature.h"
|
||
10 years ago
|
#include "commit_tx.h"
|
||
10 years ago
|
#include "bitcoin/pubkey.h"
|
||
10 years ago
|
#include <unistd.h>
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
const tal_t *ctx = tal_arr(NULL, char, 0);
|
||
|
OpenChannel *o;
|
||
|
|
||
|
err_set_progname(argv[0]);
|
||
|
|
||
|
opt_register_noarg("--help|-h", opt_usage_and_exit,
|
||
|
"<open-channel-file>\n"
|
||
|
"Prints anchor depth as contained in OpenChannel message",
|
||
|
"Print this message.");
|
||
|
|
||
|
opt_parse(&argc, argv, opt_log_stderr_exit);
|
||
|
|
||
|
if (argc != 2)
|
||
|
opt_usage_exit_fail("Expected one argument");
|
||
|
|
||
|
o = pkt_from_file(argv[1], PKT__PKT_OPEN)->open;
|
||
|
printf("%u\n", o->anchor->min_confirms);
|
||
|
|
||
|
tal_free(ctx);
|
||
|
return 0;
|
||
|
}
|
||
|
|