plan: add some clarifying docs#824
Conversation
"The size in bytes of the script sig that" is ambiguous and could refer to the actual scriptSig, exlcuding the varint prefix that indicates its size. The code comment in witness_size is promoted to the docstring, as its helpful to anyone trying to compute the right size of a transaction.
|
@apoelstra speaking of, I just noticed that plan.satisfy() returns the scriptSig as a ScriptBuf, which does not include the var-int prefix, so it's a inconsistent that the size of the var-int prefix is included in plan.sigscript_size(). Furthermore, it's not possible to know the size of the scriptsig without the var-int prefix during planning. I think it would make sense to offer a function to return the size excluding the var-int prefix. WDYT? |
|
Oh, yeah, I like this. Definitely agreed that I am torn between deprecating the version that has the length prefix, or not. (We definitely should not just silently change the behavior of |
e89e226ec6cfee5985c92a215282c552790f36ba plan: add some clarifying docs (Marko Bencun)
Pull request description:
"The size in bytes of the script sig that" is ambiguous and could refer to the actual scriptSig, exlcuding the varint prefix that indicates its size.
The code comment in witness_size is promoted to the docstring, as its helpful to anyone trying to compute the right size of a transaction.
ACKs for top commit:
apoelstra:
ACK e89e226ec6cfee5985c92a215282c552790f36ba; successfully ran local tests; nice, good call
Tree-SHA512: 3798d921ddc477965023e6275178c42ff8b37ab03f593dd65078a4d57e7c922659a74db57f5858cc69931781e1ceff3a45d6c7b263b8220d04b594db180229ec
"The size in bytes of the script sig that" is ambiguous and could refer to the actual scriptSig, exlcuding the varint prefix that indicates its size.
The code comment in witness_size is promoted to the docstring, as its helpful to anyone trying to compute the right size of a transaction.