@ -338,8 +338,7 @@ struct feerange {
static void init_feerange ( struct feerange * feerange ,
static void init_feerange ( struct feerange * feerange ,
u64 commitment_fee ,
u64 commitment_fee ,
const u64 offer [ NUM_SIDES ] ,
const u64 offer [ NUM_SIDES ] )
bool allow_mistakes )
{
{
feerange - > min = 0 ;
feerange - > min = 0 ;
@ -350,7 +349,7 @@ static void init_feerange(struct feerange *feerange,
* in [ BOLT # 3 ] ( 03 - transactions . md # fee - calculation ) .
* in [ BOLT # 3 ] ( 03 - transactions . md # fee - calculation ) .
*/
*/
feerange - > max = commitment_fee ;
feerange - > max = commitment_fee ;
feerange - > allow_mistakes = allow_mi stak es ;
feerange - > allow_mistakes = f alse;
if ( offer [ LOCAL ] > offer [ REMOTE ] )
if ( offer [ LOCAL ] > offer [ REMOTE ] )
feerange - > higher_side = LOCAL ;
feerange - > higher_side = LOCAL ;
@ -528,12 +527,15 @@ int main(int argc, char *argv[])
}
}
/* Now we have first two points, we can init fee range. */
/* Now we have first two points, we can init fee range. */
init_feerange ( & feerange , commitment_fee , offer , deprecated_api ) ;
init_feerange ( & feerange , commitment_fee , offer ) ;
/* Apply (and check) funder offer now. */
/* Apply (and check) funder offer now. */
adjust_feerange ( & cs , gossip_index , & channel_id ,
adjust_feerange ( & cs , gossip_index , & channel_id ,
& feerange , offer [ funder ] , funder ) ;
& feerange , offer [ funder ] , funder ) ;
/* Older spec clients would make offers independently, so allow */
feerange . allow_mistakes = deprecated_api ;
/* Now any extra rounds required. */
/* Now any extra rounds required. */
while ( offer [ LOCAL ] ! = offer [ REMOTE ] ) {
while ( offer [ LOCAL ] ! = offer [ REMOTE ] ) {
/* Still don't agree: adjust feerange based on previous offer */
/* Still don't agree: adjust feerange based on previous offer */