@ -29,6 +29,7 @@ int main(int argc, char *argv[])
struct pkt * pkt ;
struct pkt * pkt ;
const tal_t * ctx = tal_arr ( NULL , char , 0 ) ;
const tal_t * ctx = tal_arr ( NULL , char , 0 ) ;
unsigned int locktime_seconds , min_confirms ;
unsigned int locktime_seconds , min_confirms ;
u64 commit_tx_fee ;
bool offer_anchor = false ;
bool offer_anchor = false ;
struct pubkey commitkey , finalkey ;
struct pubkey commitkey , finalkey ;
@ -38,6 +39,8 @@ int main(int argc, char *argv[])
locktime_seconds = LOCKTIME_MIN + 24 * 60 * 60 ;
locktime_seconds = LOCKTIME_MIN + 24 * 60 * 60 ;
/* Zero, unless they set --offer-anchor or --min-anchor-confirms */
/* Zero, unless they set --offer-anchor or --min-anchor-confirms */
min_confirms = 0 ;
min_confirms = 0 ;
/* We only need this for involuntary close, so make it larger. */
commit_tx_fee = 100000 ;
opt_register_noarg ( " --help|-h " , opt_usage_and_exit ,
opt_register_noarg ( " --help|-h " , opt_usage_and_exit ,
" <seed> <commitpubkey> <finalpubkey> \n "
" <seed> <commitpubkey> <finalpubkey> \n "
@ -52,6 +55,9 @@ int main(int argc, char *argv[])
opt_register_noarg ( " --offer-anchor " ,
opt_register_noarg ( " --offer-anchor " ,
opt_set_bool , & offer_anchor ,
opt_set_bool , & offer_anchor ,
" Offer to create anchor transaction " ) ;
" Offer to create anchor transaction " ) ;
opt_register_arg ( " --commitment-fee=<bits> " ,
opt_set_bits , opt_show_bits , & commit_tx_fee ,
" 100's of satoshi to pay for commitment " ) ;
opt_parse ( & argc , argv , opt_log_stderr_exit ) ;
opt_parse ( & argc , argv , opt_log_stderr_exit ) ;
@ -76,7 +82,8 @@ int main(int argc, char *argv[])
revocation_hash . u . u8 , sizeof ( revocation_hash . u . u8 ) ) ;
revocation_hash . u . u8 , sizeof ( revocation_hash . u . u8 ) ) ;
pkt = open_channel_pkt ( ctx , & revocation_hash , & commitkey , & finalkey ,
pkt = open_channel_pkt ( ctx , & revocation_hash , & commitkey , & finalkey ,
locktime_seconds , offer_anchor , min_confirms ) ;
locktime_seconds , offer_anchor , min_confirms ,
commit_tx_fee ) ;
if ( ! write_all ( STDOUT_FILENO , pkt , pkt_totlen ( pkt ) ) )
if ( ! write_all ( STDOUT_FILENO , pkt , pkt_totlen ( pkt ) ) )
err ( 1 , " Writing out packet " ) ;
err ( 1 , " Writing out packet " ) ;