Skip to content

Commit

Permalink
Fix: min lovelace for pure lovelace txs
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvionied committed Sep 1, 2023
1 parent 578116a commit 8f050eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Models.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ func (p *Payment) ToValue() Value.Value {
}

func (p *Payment) EnsureMinUTXO(cc Base.ChainContext) {
if len(p.Units) == 0 && p.Lovelace >= 1_000_000 {
return
}
txOut := p.ToTxOut()
am := txOut.GetAmount()
am.SetLovelace(0)
txOut.SetAmount(am)
coins := Utils.MinLovelacePostAlonzo(*txOut, cc)
if int64(p.Lovelace) < coins {
p.Lovelace = int(coins)
Expand Down

0 comments on commit 8f050eb

Please sign in to comment.