diff --git a/cmd/psweb/main.go b/cmd/psweb/main.go index f6417bc..10ce789 100644 --- a/cmd/psweb/main.go +++ b/cmd/psweb/main.go @@ -49,9 +49,10 @@ var ( //go:embed static staticFiles embed.FS //go:embed templates/*.gohtml - tplFolder embed.FS - logFile *os.File - latestVersion = version + tplFolder embed.FS + logFile *os.File + latestVersion = version + // Bitcoin sat/vB from mempool.space mempoolFeeRate = float64(0) // onchain realized transaction costs txFee = make(map[string]int64) diff --git a/cmd/psweb/templates/peer.gohtml b/cmd/psweb/templates/peer.gohtml index a4a0a68..2aa92a5 100644 --- a/cmd/psweb/templates/peer.gohtml +++ b/cmd/psweb/templates/peer.gohtml @@ -137,13 +137,6 @@ function calculateTransactionFee() { var asset = document.getElementById("asset").value; var swapAmount = Number(document.getElementById("swapAmount").value); - - // amount cannot be blank - if (swapAmount < 100000) { - document.getElementById('result').innerText = "Please enter the Swap Amount"; - return; - } - let fee = 0; let feeRate = {{.MempoolFeeRate}}; // LBTC let title = ""; @@ -156,6 +149,12 @@ // Liquid document.getElementById("mempoolFeeRate").textContent = "{{.MempoolFeeRate}} sats/vB" } + + // amount cannot be blank + if (swapAmount < 100000) { + document.getElementById('result').innerText = "Please enter the Swap Amount"; + return; + } if (document.getElementById("direction").value == "swapIn") { title = "Assumed UTXOs:\n";