lightningd/commit_tx: support for printing out actual tx fees.

This was included in the lightningnetwork/lightning-rfc#105 update
to the test vectors, and it's a good idea.  Takes a bit of work to
calculate (particularly, being aware of rounding issues).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-03-07 16:19:11 +10:30
parent 29d6004efc
commit 8d01eeeef5
2 changed files with 21 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
static bool print_superverbose;
#define SUPERVERBOSE(...) \
do { if (print_superverbose) printf(__VA_ARGS__); } while(0)
#define PRINT_ACTUAL_FEE
#include "../commit_tx.c"
#include "../htlc_tx.c"
#include <bitcoin/preimage.h>
@@ -15,6 +16,9 @@ static bool print_superverbose;
#include <ccan/str/hex/hex.h>
#include <type_to_string.h>
/* Turn this on to brute-force fee values */
/*#define DEBUG */
static struct sha256 sha256_from_hex(const char *hex)
{
struct sha256 sha256;