Home Bitcoin Understanding price calculation in Bitcoin Core

Understanding price calculation in Bitcoin Core

0
Understanding price calculation in Bitcoin Core

[ad_1]

Within the following put up Calculating price primarily based on price charge for bitcoin transaction the respondent describes how the charges may be calculated.

Since your transaction constructing begins with a recognized goal feerate, and you realize the dimensions of the transaction header information and outputs, you may calculate their charges prematurely.

Nonetheless, AFAKT, the bitcoin core SRD algorithm solely accounts for a single output, the change output (change_fee):

https://github.com/bitcoin/bitcoin/blob/c2ff87e1fa35e1edfa434ac6f341a141d3545257/src/pockets/coinselection.cpp#L204C47-L204C47

Within the line about, the target_value is incremented by the CHANGE_LOWER (mud restrict) and the price of producing a change output (change_fee). That means, the change quantity is bigger than the mud restrict and may pay for the price of making the change output. Nonetheless, this doesn’t account for paying for the remaining output nor the transaction header fields as described within the above hyperlink. Why is it not essential so as to add the dimensions of theses respective transaction components when setting the target_value in SRD?

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here