Skip to content

Commit

Permalink
adding missing varint from p2pkh
Browse files Browse the repository at this point in the history
  • Loading branch information
theflyingcodr committed Jul 26, 2021
1 parent c32dfff commit aba1414
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ func (tx *Tx) canAddChange(available uint64, standardFees *Fee) bool {
}

changeOutputFee := uint64(varIntUpper)

changeP2pkhByteLen := 8 + 1 + 25 // 8 bytes for satoshi value +1 for varint length + 25 bytes for p2pkh script (e.g. 76a914cc...05388ac)
// 8 bytes for satoshi value +1 for varint length + 25 bytes for p2pkh script (e.g. 76a914cc...05388ac)
changeP2pkhByteLen := 8 + 1 + 25
changeOutputFee += uint64(changeP2pkhByteLen * standardFees.MiningFee.Satoshis / standardFees.MiningFee.Bytes)

// not enough change to add a whole change output so don't add anything and return
Expand Down

0 comments on commit aba1414

Please sign in to comment.