Add comments of BOLT quote about 'htlc_maximum_mast' bound

s channeld.c

s channeld.c
This commit is contained in:
trueptolemy
2019-04-05 22:46:09 +08:00
committed by neil saitug
parent 90f9985dd2
commit d140e927bf

View File

@@ -265,9 +265,18 @@ static struct amount_msat advertised_htlc_max(const struct channel *channel)
type_to_string(tmpctx, struct amount_sat,
&lower_bound));
}
/* FIXME BOLT QUOTE: https://github.com/lightningnetwork/lightning-rfc/pull/512 once merged */
if (amount_msat_greater(lower_bound_msat,
channel->chainparams->max_payment))
/* BOLT #7:
*
* The origin node:
* ...
* - if the `htlc_maximum_msat` field is present:
* ...
* - for channels with `chain_hash` identifying the Bitcoin blockchain:
* - MUST set this to less than 2^32.
*/
lower_bound_msat = channel->chainparams->max_payment;
return lower_bound_msat;