Replace tab by space everywhere

This commit is contained in:
Jochen Hoenicke 2018-09-30 15:39:05 +02:00
parent e5458cc164
commit 3d735f1199
6 changed files with 48 additions and 48 deletions

View File

@ -27,23 +27,23 @@ while(<>) {
/"descendantfees": (\d+)/ and $dfees = $1;
if (/},/) {
$afpb = $afees / $asize; # ancestor fee (includes current)
$fpb = $fee / $size; # current fee
$dfpb = $dfees / $dsize; # descendant fee (includes current)
# total average fee for mining all ancestors and descendants.
$tfpb = ($afees + $dfees - $fee) / ($asize + $dsize - $size);
# the "min"s ensure we take the fee level of ancestors in account
# if and only if they pay less (like a miner would do).
# the "max" ensures we take the descendants into account for CPFP.
$feeperbyte = max(min($dfpb, $tfpb), min($fpb, $afpb));
for ($i = 0; $i< @feelimit-1; $i++) {
if ($feeperbyte >= $feelimit[$i] && $feeperbyte < $feelimit[$i+1]) {
$total[$i] += $size;
$count[$i]++;
$fees[$i] += $fee;
}
}
$found = 1;
$afpb = $afees / $asize; # ancestor fee (includes current)
$fpb = $fee / $size; # current fee
$dfpb = $dfees / $dsize; # descendant fee (includes current)
# total average fee for mining all ancestors and descendants.
$tfpb = ($afees + $dfees - $fee) / ($asize + $dsize - $size);
# the "min"s ensure we take the fee level of ancestors in account
# if and only if they pay less (like a miner would do).
# the "max" ensures we take the descendants into account for CPFP.
$feeperbyte = max(min($dfpb, $tfpb), min($fpb, $afpb));
for ($i = 0; $i< @feelimit-1; $i++) {
if ($feeperbyte >= $feelimit[$i] && $feeperbyte < $feelimit[$i+1]) {
$total[$i] += $size;
$count[$i]++;
$fees[$i] += $fee;
}
}
$found = 1;
}
}
if ($found) {

View File

@ -6,18 +6,18 @@ use Data::Dumper;
my $port = 8332;
if (open COOKIE, "<$ENV{HOME}/.bitcoin/.cookie") {
$_=<COOKIE>;
($user,$pwd) = split ":", $_;
close COOKIE;
$_=<COOKIE>;
($user,$pwd) = split ":", $_;
close COOKIE;
} elsif (open CONFIG, "<$ENV{HOME}/.bitcoin/bitcoin.conf") {
while (<CONFIG>) {
/rpcuser=(.*)/ and $user = $1;
/rpcpassword=(.*)/ and $pwd = $1;
}
close CONFIG;
while (<CONFIG>) {
/rpcuser=(.*)/ and $user = $1;
/rpcpassword=(.*)/ and $pwd = $1;
}
close CONFIG;
} else {
print "Cannot find credentials!";
exit;
print "Cannot find credentials!";
exit;
}
my $client = new JSON::RPC::Legacy::Client;
@ -33,7 +33,7 @@ while(<>) {
});
if ($res) {
if ($res->is_error) {
print "Tx: $_ \n";
print "Tx: $_ \n";
print "Error: ", Dumper($res->error_message);
}
} else {

View File

@ -12,7 +12,7 @@ in your httpd cgi configuration. I use lighttpd with:
```
$HTTP["url"] =~ "^/lnd/" {
cgi.assign = ( ".py" => "/home/lnd/lnd/bin/python" )
cgi.assign = ( ".py" => "/home/lnd/lnd/bin/python" )
}
```

View File

@ -77,9 +77,9 @@
if (!response.settled) {
waitfor(rhash);
} else {
document.getElementById("qrinvoice").style.opacity = 0.2;
document.getElementById("qrpayed").style.display = "block";
}
document.getElementById("qrinvoice").style.opacity = 0.2;
document.getElementById("qrpayed").style.display = "block";
}
} else if (this.status != 0) {
alert("Cannot check payment status: "+ this.status + " state: "+this.readyState+"text: "+this.responseText);
}
@ -126,7 +126,7 @@
function loadDoc() {
requestInvoice(0, "Donation to Johoe's mempool");
}
function selectTab(button, name) {
// Declare all variables
var i, tabcontent, tablinks;
@ -156,8 +156,8 @@
document.getElementById("defaulttab").click();
</script>
<div class="centered" style="font-size: 13px; margin: 20px;">
Source code on github: <a href="https://github.com/jhoenicke/mempool/tree/master/web/lightning/" target="_blank">https://github.com/jhoenicke/mempool</a><br/>
© 2018 <a href="https://jochen-hoenicke.de/">Jochen Hoenicke</a>
Source code on github: <a href="https://github.com/jhoenicke/mempool/tree/master/web/lightning/" target="_blank">https://github.com/jhoenicke/mempool</a><br/>
© 2018 <a href="https://jochen-hoenicke.de/">Jochen Hoenicke</a>
</div>
</body>
</html>

View File

@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$dbtype = "mysql";
$dbtype = "mysql";
$dbdatabase = "dbname=btc_mempool;host=localhost";
$dbdsn = "$dbtype:$dbdatabase";
$dbuser = "www";
@ -49,16 +49,16 @@ try {
echo 'call([';
$comma="";
while ($row = $query->fetch(PDO::FETCH_NUM)) {
for ($i = 0; $i < 3*$feelevels+1; $i++) {
if (!isset($row[$i])) {
for ($i = 0; $i < 3*$feelevels+1; $i++) {
if (!isset($row[$i])) {
$row[$i] = 0;
}
}
echo $comma.'['.$row[0].',['.
join(',', array_slice($row, 1, $feelevels)).'],['.
join(',', array_slice($row, 1 + $feelevels, $feelevels)).'],['.
join(',', array_slice($row, 1 + 2*$feelevels, $feelevels)).']]';
$comma = ",\n";
}
echo $comma.'['.$row[0].',['.
join(',', array_slice($row, 1, $feelevels)).'],['.
join(',', array_slice($row, 1 + $feelevels, $feelevels)).'],['.
join(',', array_slice($row, 1 + 2*$feelevels, $feelevels)).']]';
$comma = ",\n";
}
echo "]);\n";
exit;

View File

@ -48,7 +48,7 @@
<div class="centered">
<div class="donation">
<a href="bitcoin:bc1qs5q679tac0uvfunt0gdwuymves5re7v7q8fntv"><div class="qrcontainer"><img class="cover pixelated qrcode" width="148" height="148" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAlAQMAAAD/ULJAAAAABlBMVEX///8AAABVwtN+AAAA0UlEQVQI12NABvatT/kfMCjsM/BQYNBbq+O9gEGvtTMbRO54vYBBYYYmUNx+1ar1DxgY+FkVGBhkezIOHGCwkb3EosAgMIv7fAODarrpzgQGsduHNyxgkEoycklgsFj7XcaBQcft4yIGBo7lzOUKDII5LT0LGLSmW2smMIi4Cvx2YBCe9uQgA4OGT9L2BQzcF6brLGAQze/ybWDQ7hexA1pjoJ0MtHfSbi2g29Z1JAHdNunC/wcMevtZ1zAw6C07lcbAoLB9twjQ/X1bnA8gewgAMu1BFLs54BYAAAAASUVORK5CYII=" alt=""/><img class="qrlogo" src="bc-logo-32x32.png" alt=""/></div></a><a href="#" onClick="window.open('../lightning/','ln','resizeable,height=600,width=500'); return false;"><img class="bolt" src="../lightning/lightning-bolt.png" alt="lightning" /></a><br />
bitcoin:<a href="bitcoin:bc1qs5q679tac0uvfunt0gdwuymves5re7v7q8fntv">bc1qs5q679tac0uvfunt0gdwuymves5re7v7q8fntv</a><br/>
bitcoin:<a href="bitcoin:bc1qs5q679tac0uvfunt0gdwuymves5re7v7q8fntv">bc1qs5q679tac0uvfunt0gdwuymves5re7v7q8fntv</a><br/>
(old bitcoin:<a href="bitcoin:3LrXizKejCGYyGUxYzGweyuxFVtfs3odEe">3LrXizKejCGYyGUxYzGweyuxFVtfs3odEe</a>)
</div>
<div class="donation">
@ -58,14 +58,14 @@
</div>
<div class="donation">
<a href="litecoin:ltc1qp2qsuh73rrj8gxpvw65ck554qfnv8s5pke3qzm"><div class="qrcontainer"><img class="cover pixelated qrcode" width="148" height="148" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAlAQMAAAD/ULJAAAAABlBMVEX///8AAABVwtN+AAAA1ElEQVQI12NABvZTW9Y/YFDojj2hwKA3vWv1Aga9Za9OA8nJ+14vYFDY9LlDgcF+1SqgGgY1DwcGBom2u7oMDLLxCVkPGASe2O9OYBDOWnNTgcH22v32BwxmjtKvHjCIvZiV94BBqVB8IQOD9J0bmxkYFIVL9Q8wyK2LE0xgEKlbH/aAgeu0pOMCBkbWB4wJDGY/dGoeMDAnGgYpMJjfELU/wMBg8OnxAaDbQlc1MChM+LcI6La50f8aGPQaTy08wKC3taof6ObFYl1At034mJuA7CEA8yNLCukmy7UAAAAASUVORK5CYII=" alt=""/><img class="qrlogo" src="ltc-32px.png" alt=""/></div></a><br />
litecoin:<a href="litecoin:ltc1qp2qsuh73rrj8gxpvw65ck554qfnv8s5pke3qzm">ltc1qp2qsuh73rrj8gxpvw65ck554qfnv8s5pke3qzm</a><br/>
litecoin:<a href="litecoin:ltc1qp2qsuh73rrj8gxpvw65ck554qfnv8s5pke3qzm">ltc1qp2qsuh73rrj8gxpvw65ck554qfnv8s5pke3qzm</a><br/>
(old litecoin:<a href="litecoin:MK7jfGG48RTsETCXTAz1wP27uVoFhBUV5o">MK7jfGG48RTsETCXTAz1wP27uVoFhBUV5o</a>)
</div>
<p>
ethereum: <span class="cover pixelated" style="width: 20px;height:20px; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAgMAAAC5YVYYAAAACVBMVEWV5Xgyfg0qispl6+N0AAAAH0lEQVQI12NwYGRwdGQIDWVQkWBwEWSYwMagNgMoAgAqGwPVVzuqWQAAAABJRU5ErkJggg==); border-radius: 50%; display: inline-block;"></span>&nbsp;mempool.hoenicke.eth</p>
ethereum: <span class="cover pixelated" style="width: 20px;height:20px; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAgMAAAC5YVYYAAAACVBMVEWV5Xgyfg0qispl6+N0AAAAH0lEQVQI12NwYGRwdGQIDWVQkWBwEWSYwMagNgMoAgAqGwPVVzuqWQAAAABJRU5ErkJggg==); border-radius: 50%; display: inline-block;"></span>&nbsp;mempool.hoenicke.eth</p>
</div>
<div class="centered" style="font-size: 13px; margin: 20px;">
Source code on github: <a href="https://github.com/jhoenicke/mempool">https://github.com/jhoenicke/mempool</a><br/>
Source code on github: <a href="https://github.com/jhoenicke/mempool">https://github.com/jhoenicke/mempool</a><br/>
© 2016-2018 <a href="https://jochen-hoenicke.de/">Jochen Hoenicke</a>
</div>
</html>