From 8f050eb2227992cc93eb31018d13b8aa341f469a Mon Sep 17 00:00:00 2001 From: Salvionied Date: Fri, 1 Sep 2023 13:45:49 +0200 Subject: [PATCH] Fix: min lovelace for pure lovelace txs --- Models.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Models.go b/Models.go index 084b65d..fd3a786 100644 --- a/Models.go +++ b/Models.go @@ -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)