rust-bitcoin-unsafe-fast/bitcoin
Andrew Poelstra 64540b9b93
Merge rust-bitcoin/rust-bitcoin#1793: Comment predict_weight
dff757d7db Comment predict_weight (yancy)

Pull request description:

  I've been reading over the `predict_weight` function since it is one of the biggest challenges for coin-selection.  IE choosing inputs and constructing an optimal selection strategy requires predicting the weight to get the best selection.  It's great this work has been done but there are some things I don't understand well enough to comment.

  1) why are we looking at the size of VarInt struct here
  > let script_size = script_len + VarInt(script_len as u64).len()

  2) [predict_weight_internal](36500b4451/bitcoin/src/blockdata/transaction.rs (L1245)) has a bunch of magic numbers.  I'd like to be able to comment this as well but I don't fully understand that function.

  Also, `Transaction.rs` is a big file and it seems like all of the prediction stuff could be moved to a separate module or maybe a separate crate?

ACKs for top commit:
  tcharding:
    ACK dff757d7db
  Kixunil:
    ACK dff757d7db

Tree-SHA512: 8ffa16d500075d691528ce1819b9352a148af431889bebbd7cddcf470bd4e3048ec53a5e778bc3659e33d8c25b68422a93dac1d46b9489ff56f41d88d7f05433
2023-05-05 02:55:23 +00:00
..
contrib Test with minimal dependency versions 2023-05-03 08:06:46 +10:00
embedded embedded: Remove error handler 2023-04-26 14:29:39 +10:00
examples Use Amount type for TxOut value field 2023-05-04 17:09:08 +02:00
src Merge rust-bitcoin/rust-bitcoin#1793: Comment predict_weight 2023-05-05 02:55:23 +00:00
tests Use Amount type for TxOut value field 2023-05-04 17:09:08 +02:00
CHANGELOG.md Bump version to v0.30.0 2023-03-22 08:41:21 +11:00
Cargo.toml Bump core2 dependency from 0.3.0 -> 0.3.2 2023-05-01 10:07:43 +10:00
build.rs Remove rust_v_1_46 2023-03-23 08:27:10 +11:00