Skip to content
This repository was archived by the owner on Jul 17, 2023. It is now read-only.
This repository was archived by the owner on Jul 17, 2023. It is now read-only.

Fix estimation of tx inputs #142

Description

@altafan

At the moment, the estimateTxSize function expects a simple numInputs arg becuase it assumes all inputs are of type p2wpkh | p2sh(p2wpkh), therefore the estimation for txs that include other types of inputs may not be accurate.

This can be fixed by expecting a list of input script types + 2 lists of auxiliary redeeem script sizes and witness sizes instead of the numInputs one. The auxiliary arrays can be easily reconstructed from a pset in wallet.buildTx, or properly crafted from wallet info in wallet.sendTx

Take a look here for a reference implementation.

Activity

  1. tiero commented on Oct 11, 2022

    @tiero
    Member

    Duplicated of this #113

    Closing that since less detailed.

    NOTICE: reference implementation do not support OP_RETURN and PUSHDATA weighting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions