let tx = msg.prevtx.as_transaction();
let input = TxIn {
previous_output: OutPoint { txid: tx.txid(), vout: msg.prevtx_out },
sequence: Sequence(msg.sequence),
..Default::default()
};
let tx = msg.prevtx.as_transaction();
let input = TxIn {
previous_output: OutPoint { txid: tx.txid(), vout: msg.prevtx_out },
sequence: Sequence(msg.sequence),
..Default::default()
};
const INPUT_WEIGHT: u64 = BASE_INPUT_WEIGHT + EMPTY_SCRIPT_SIG_WEIGHT;
// - the peer's paid feerate does not meet or exceed the agreed feerate (based on the minimum fee).
const INPUT_WEIGHT: u64 = BASE_INPUT_WEIGHT + EMPTY_SCRIPT_SIG_WEIGHT;
// - the peer's paid feerate does not meet or exceed the agreed feerate (based on the minimum fee).
.counterparty_outputs_contributed()
.map(|output| {
(8 /* value */ + output.script_pubkey.consensus_encode(&mut sink()).unwrap() as u64)
* WITNESS_SCALE_FACTOR as u64
})
.sum();
.counterparty_outputs_contributed()
.map(|output| {
(8 /* value */ + output.script_pubkey.consensus_encode(&mut sink()).unwrap() as u64)
* WITNESS_SCALE_FACTOR as u64
})
.sum();
- let counterparty_weight_contributed = counterparty_output_weight_contributed
- + self.counterparty_inputs_contributed().count() as u64 * INPUT_WEIGHT;
+ counterparty_weight_contributed +=
+ self.counterparty_inputs_contributed().count() as u64 * INPUT_WEIGHT;
let counterparty_fees_contributed =
counterparty_inputs_value.saturating_sub(counterparty_outputs_value);
let mut required_counterparty_contribution_fee =
let counterparty_fees_contributed =
counterparty_inputs_value.saturating_sub(counterparty_outputs_value);
let mut required_counterparty_contribution_fee =
impl<S: ReceivedMsgState> StateTransition<SentChangeMsg, $data> for S {
fn transition(self, data: $data) -> StateTransitionResult<SentChangeMsg> {
let mut context = self.into_negotiation_context();
impl<S: ReceivedMsgState> StateTransition<SentChangeMsg, $data> for S {
fn transition(self, data: $data) -> StateTransitionResult<SentChangeMsg> {
let mut context = self.into_negotiation_context();