Browse Source

feerate: remove duplicate method

is dupe of `bitcoin_tx_core_weight`
travis-experimental
niftynei 4 years ago
committed by Rusty Russell
parent
commit
8317957db2
  1. 9
      bitcoin/feerate.c
  2. 5
      bitcoin/feerate.h
  3. 3
      openingd/dualopend.c

9
bitcoin/feerate.c

@ -39,12 +39,3 @@ const char *feerate_style_name(enum feerate_style style)
}
abort();
}
size_t common_weight(size_t num_inputs, size_t num_outputs)
{
/*(nVersion + num inputs + num outputs + locktime) * 4
* + SegWit marker + SegWit flag */
return (4 + varint_size(num_inputs) +
varint_size(num_outputs) + 4) * 4
+ 1 + 1;
}

5
bitcoin/feerate.h

@ -34,11 +34,6 @@
*/
#define FEERATE_FLOOR 253
/*
* This is the net common weight of a transaction.
*/
size_t common_weight(size_t num_inputs, size_t num_outputs);
enum feerate_style {
FEERATE_PER_KSIPA,
FEERATE_PER_KBYTE

3
openingd/dualopend.c

@ -279,7 +279,8 @@ static bool check_balances(struct state *state,
if (check_opener_balance) {
u8 *funding_wscript;
weight = common_weight(psbt->num_inputs, psbt->num_outputs);
weight = bitcoin_tx_core_weight(psbt->num_inputs,
psbt->num_outputs);
funding_wscript = bitcoin_redeem_2of2(tmpctx,
&state->our_funding_pubkey,
&state->their_funding_pubkey);

Loading…
Cancel
Save