You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cache fields instead of storing a ChannelKeys in ChannelMonitor
We only actually use two of the fields in ChannelKeys inside a
ChannelMonitor - the holder revocation_basepoint and the
derivation parameters. Both are relatively small, so there isn't
a lot of reason to hold a full copy of the ChannelKeys (with most
of the interaction with it being inside the OnchainTxHandler).
Further, this will avoid calling read on a `ChannelKeys` twice,
which is a somewhat strange API quirk.
let secret = self.get_secret(commitment_number).unwrap();
1374
1380
let per_commitment_key = ignore_error!(SecretKey::from_slice(&secret));
1375
1381
let per_commitment_point = PublicKey::from_secret_key(&self.secp_ctx,&per_commitment_key);
1376
-
let revocation_pubkey = ignore_error!(chan_utils::derive_public_revocation_key(&self.secp_ctx,&per_commitment_point,&self.keys.pubkeys().revocation_basepoint));
1382
+
let revocation_pubkey = ignore_error!(chan_utils::derive_public_revocation_key(&self.secp_ctx,&per_commitment_point,&self.holder_revocation_basepoint));
1377
1383
let delayed_key = ignore_error!(chan_utils::derive_public_key(&self.secp_ctx,&PublicKey::from_secret_key(&self.secp_ctx,&per_commitment_key),&self.counterparty_tx_cache.counterparty_delayed_payment_base_key));
1378
1384
1379
1385
let revokeable_redeemscript = chan_utils::get_revokeable_redeemscript(&revocation_pubkey,self.counterparty_tx_cache.on_counterparty_tx_csv,&delayed_key);
0 commit comments