daemon: handle feechange requests.

I originally overloaded struct htlc for this, as they go through the
same states, but separating them turned out to be clearer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-08-26 15:31:19 +09:30
parent 2c7256ac69
commit e7b003b499
10 changed files with 488 additions and 47 deletions

View File

@@ -178,6 +178,16 @@ void queue_pkt_htlc_fail(struct peer *peer, struct htlc *htlc)
queue_pkt(peer, PKT__PKT_UPDATE_FAIL_HTLC, f);
}
void queue_pkt_feechange(struct peer *peer, u64 feerate)
{
UpdateFee *f = tal(peer, UpdateFee);
update_fee__init(f);
f->fee_rate = feerate;
queue_pkt(peer, PKT__PKT_UPDATE_FEE, f);
}
/* OK, we're sending a signature for their pending changes. */
void queue_pkt_commit(struct peer *peer, const struct bitcoin_signature *sig)
{