diff --git a/closingd/closing.c b/closingd/closing.c index 5548eb7e6..faabb6dd2 100644 --- a/closingd/closing.c +++ b/closingd/closing.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -497,6 +498,10 @@ int main(int argc, char *argv[]) do_reconnect(&cs, gossip_index, &channel_id, next_index, revocations_received); + peer_billboard(true, "Negotiating closing fee between %"PRIu64 + " and %"PRIu64" satoshi (ideal %"PRIu64")", + min_fee_to_accept, commitment_fee, offer[LOCAL]); + /* BOLT #2: * * The funding node: @@ -514,6 +519,14 @@ int main(int argc, char *argv[]) funding_satoshi, satoshi_out, funder, our_dust_limit, &secrets, offer[LOCAL]); } else { + if (i == 0) + peer_billboard(false, "Waiting for their initial" + " closing fee offer"); + else + peer_billboard(false, "Waiting for their initial" + " closing fee offer:" + " ours was %"PRIu64" satoshi", + offer[LOCAL]); offer[REMOTE] = receive_offer(&cs, gossip_index, &channel_id, funding_pubkey, @@ -554,6 +567,11 @@ int main(int argc, char *argv[]) funding_satoshi, satoshi_out, funder, our_dust_limit, &secrets, offer[LOCAL]); } else { + peer_billboard(false, "Waiting for another" + " closing fee offer:" + " ours was %"PRIu64" satoshi," + " theirs was %"PRIu64" satoshi,", + offer[LOCAL], offer[REMOTE]); offer[REMOTE] = receive_offer(&cs, gossip_index, &channel_id, funding_pubkey, @@ -566,6 +584,9 @@ int main(int argc, char *argv[]) } } + peer_billboard(true, "We agreed on a closing fee of %"PRIu64" satoshi", + offer[LOCAL]); + /* We're done! */ wire_sync_write(REQ_FD, take(towire_closing_complete(ctx, gossip_index))); diff --git a/onchaind/onchain.c b/onchaind/onchain.c index 8306b6578..707621de4 100644 --- a/onchaind/onchain.c +++ b/onchaind/onchain.c @@ -76,6 +76,8 @@ struct tracked_output { enum tx_type tx_type; struct bitcoin_txid txid; u32 tx_blockheight; + /* FIXME: Convert all depths to blocknums, then just get new blk msgs */ + u32 depth; u32 outnum; u64 satoshi; enum output_type output_type; @@ -278,6 +280,7 @@ static struct tracked_output * out->tx_type = tx_type; out->txid = *txid; out->tx_blockheight = tx_blockheight; + out->depth = 0; out->outnum = outnum; out->satoshi = satoshi; out->output_type = output_type; @@ -810,6 +813,10 @@ static void tx_new_depth(struct tracked_output **outs, } for (i = 0; i < tal_count(outs); i++) { + /* Update output depth. */ + if (structeq(&outs[i]->txid, txid)) + outs[i]->depth = depth; + /* Is this tx resolving an output? */ if (outs[i]->resolved) { if (structeq(&outs[i]->resolved->txid, txid)) {