| 997 | } |
| 998 | |
| 999 | u32 tx_feerate(const struct bitcoin_tx *tx) |
| 1000 | { |
| 1001 | |
| 1002 | u32 feerate; |
| 1003 | |
| 1004 | /* Fee should not overflow! */ |
| 1005 | if (!amount_feerate(&feerate, |
| 1006 | bitcoin_tx_compute_fee(tx), |
| 1007 | bitcoin_tx_weight(tx))) { |
| 1008 | abort(); |
| 1009 | } |
| 1010 | |
| 1011 | return feerate; |
| 1012 | } |