From e19bdb2160484329fd1c67c2e31fcddb1e52c1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AF=94=E7=89=B9=E5=B8=81=E5=B8=83=E9=81=93=E8=80=85?= <138196104+happybole@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:58:20 +0800 Subject: [PATCH] Update walletjs.html 1.Adjust the number of characters in each QR code from 400 to 250. 2.There is an error in the calculation of the miner fee per byte, which has been corrected. --- walletjs.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/walletjs.html b/walletjs.html index 5a2381b..8380937 100644 --- a/walletjs.html +++ b/walletjs.html @@ -1605,7 +1605,7 @@ //生成二维码 function generateQrcode(content, parentElement){ - var arr = mySplit(content, 400); + var arr = mySplit(content, 250); for(var i = 0; i < arr.length; i++){ jQuery(function(){jQuery("#" + parentElement).qrcode(str2rstr_utf8(arr[i]));}); document.getElementById(parentElement).appendChild(document.createElement("br")); @@ -1640,8 +1640,10 @@ } txOutValue = txOutValue * 100000000; - var vBytes = Math.round((txInValue - txOutValue) / txSignedRawObj.txJSON.hex_raw_length * 100) / 100; //保留两位小数 - return vBytes; + var txFee = txInValue - txOutValue; + var vBytes = txSignedRawObj.txJSON.hex_raw_length / 2; + var feepervB = Math.round(txFee / vBytes * 100) / 100; //保留两位小数 + return feepervB; }