@@ -1423,46 +1423,16 @@ static struct io_plan *handle_sign_local_htlc_tx(struct io_conn *conn,
14231423{
14241424 u64 commit_num ;
14251425 struct amount_sat input_sat ;
1426- struct secret channel_seed , htlc_basepoint_secret ;
1427- struct sha256 shaseed ;
1428- struct pubkey per_commitment_point , htlc_basepoint ;
14291426 struct bitcoin_tx * tx ;
14301427 u8 * wscript ;
14311428 struct bitcoin_signature sig ;
1432- struct privkey htlc_privkey ;
1433- struct pubkey htlc_pubkey ;
14341429
14351430 if (!fromwire_hsm_sign_local_htlc_tx (tmpctx , msg_in ,
14361431 & commit_num , & tx , & wscript ,
14371432 & input_sat ))
14381433 return bad_req (conn , c , msg_in );
14391434
14401435 tx -> chainparams = c -> chainparams ;
1441- get_channel_seed (& c -> id , c -> dbid , & channel_seed );
1442-
1443- if (!derive_shaseed (& channel_seed , & shaseed ))
1444- return bad_req_fmt (conn , c , msg_in , "bad derive_shaseed" );
1445-
1446- if (!per_commit_point (& shaseed , & per_commitment_point , commit_num ))
1447- return bad_req_fmt (conn , c , msg_in ,
1448- "bad per_commitment_point %" PRIu64 ,
1449- commit_num );
1450-
1451- if (!derive_htlc_basepoint (& channel_seed ,
1452- & htlc_basepoint ,
1453- & htlc_basepoint_secret ))
1454- return bad_req_fmt (conn , c , msg_in ,
1455- "Failed deriving htlc basepoint" );
1456-
1457- if (!derive_simple_privkey (& htlc_basepoint_secret ,
1458- & htlc_basepoint ,
1459- & per_commitment_point ,
1460- & htlc_privkey ))
1461- return bad_req_fmt (conn , c , msg_in ,
1462- "Failed deriving htlc privkey" );
1463-
1464- if (!pubkey_from_privkey (& htlc_privkey , & htlc_pubkey ))
1465- return bad_req_fmt (conn , c , msg_in , "bad pubkey_from_privkey" );
14661436
14671437 if (tx -> wtx -> num_inputs != 1 )
14681438 return bad_req_fmt (conn , c , msg_in , "bad txinput count" );
@@ -1478,13 +1448,7 @@ static struct io_plan *handle_sign_local_htlc_tx(struct io_conn *conn,
14781448 return bad_req_fmt (conn , c , msg_in ,
14791449 "proxy_%s error: %s" , __FUNCTION__ ,
14801450 proxy_last_message ());
1481- g_proxy_impl = PROXY_IMPL_MARSHALED ;
1482-
1483- /* FIXME - REPLACE BELOW W/ REMOTE RETURN */
1484-
1485- /* FIXME: Check that output script is correct! */
1486- sign_tx_input (tx , 0 , NULL , wscript , & htlc_privkey , & htlc_pubkey ,
1487- SIGHASH_ALL , & sig );
1451+ g_proxy_impl = PROXY_IMPL_COMPLETE ;
14881452
14891453 return req_reply (conn , c , take (towire_hsm_sign_tx_reply (NULL , & sig )));
14901454}
0 commit comments