Merge branch 'master' into mononaut/scrollable-blockchain

This commit is contained in:
wiz
2023-01-12 22:01:45 +09:00
committed by GitHub
30 changed files with 600 additions and 146 deletions

View File

@@ -36,7 +36,9 @@ export class AddressLabelsComponent implements OnChanges {
handleChannel() {
const type = this.vout ? 'open' : 'close';
this.label = `Channel ${type}: ${this.channel.node_left.alias} <> ${this.channel.node_right.alias}`;
const leftNodeName = this.channel.node_left.alias || this.channel.node_left.public_key.substring(0, 10);
const rightNodeName = this.channel.node_right.alias || this.channel.node_right.public_key.substring(0, 10);
this.label = `Channel ${type}: ${leftNodeName} <> ${rightNodeName}`;
}
handleVin() {

View File

@@ -5,7 +5,7 @@
<app-search-results #searchResults [hidden]="dropdownHidden" [results]="typeAhead$ | async" (selectedResult)="selectedResult($event)"></app-search-results>
</div>
<div>
<button [disabled]="isSearching" type="submit" class="btn btn-block btn-primary">
<button [disabled]="isSearching" type="submit" class="btn btn-block btn-purple">
<fa-icon *ngIf="!(isTypeaheading$ | async) else searchLoading" [icon]="['fas', 'search']" [fixedWidth]="true" i18n-title="search-form.search-title" title="Search"></fa-icon>
</button>
</div>

View File

@@ -43,9 +43,6 @@ form {
@media (min-width: 1200px) {
min-width: 300px;
}
input {
border: 0px;
}
.btn {
width: 100px;
}

View File

@@ -133,26 +133,20 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.cpfpInfo = null;
return;
}
if (cpfpInfo.effectiveFeePerVsize) {
this.tx.effectiveFeePerVsize = cpfpInfo.effectiveFeePerVsize;
} else {
const lowerFeeParents = cpfpInfo.ancestors.filter(
(parent) => parent.fee / (parent.weight / 4) < this.tx.feePerVsize
);
let totalWeight =
this.tx.weight +
lowerFeeParents.reduce((prev, val) => prev + val.weight, 0);
let totalFees =
this.tx.fee +
lowerFeeParents.reduce((prev, val) => prev + val.fee, 0);
if (cpfpInfo?.bestDescendant) {
totalWeight += cpfpInfo?.bestDescendant.weight;
totalFees += cpfpInfo?.bestDescendant.fee;
}
this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
// merge ancestors/descendants
const relatives = [...(cpfpInfo.ancestors || []), ...(cpfpInfo.descendants || [])];
if (cpfpInfo.bestDescendant && !cpfpInfo.descendants?.length) {
relatives.push(cpfpInfo.bestDescendant);
}
let totalWeight =
this.tx.weight +
relatives.reduce((prev, val) => prev + val.weight, 0);
let totalFees =
this.tx.fee +
relatives.reduce((prev, val) => prev + val.fee, 0);
this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
if (!this.tx.status.confirmed) {
this.stateService.markBlock$.next({
txFeePerVSize: this.tx.effectiveFeePerVsize,

View File

@@ -24,7 +24,6 @@ export interface CpfpInfo {
ancestors: Ancestor[];
descendants?: Ancestor[];
bestDescendant?: BestDescendant | null;
effectiveFeePerVsize?: number;
}
export interface DifficultyAdjustment {

View File

@@ -115,10 +115,38 @@ body {
}
.form-control {
color: #495057;
color: #fff;
background-color: #2d3348;
border: 1px solid rgba(17, 19, 31, 0.2);
}
.form-control:focus {
color: #000;
color: #fff;
background-color: #2d3348;
}
.btn-purple {
background-color: #653b9c;
border-color: #653b9c;
}
.btn-purple:not(:disabled):not(.disabled):active, .btn-purple:not(:disabled):not(.disabled).active, .show > .btn-purple.dropdown-toggle {
color: #fff;
background-color: #4d2d77;
border-color: #472a6e;
}
.btn-purple:focus, .btn-purple.focus {
color: #fff;
background-color: #533180;
border-color: #4d2d77;
box-shadow: 0 0 0 0.2rem rgb(124 88 171 / 50%);
}
.btn-purple:hover {
color: #fff;
background-color: #533180;
border-color: #4d2d77;
}
.form-control.form-control-secondary {

View File

@@ -54,9 +54,13 @@ function downloadMiningPoolLogos() {
response.on('end', () => {
let response_body = Buffer.concat(chunks_of_data);
const poolLogos = JSON.parse(response_body.toString());
for (const poolLogo of poolLogos) {
download(`${PATH}/mining-pools/${poolLogo.name}`, poolLogo.download_url);
try {
const poolLogos = JSON.parse(response_body.toString());
for (const poolLogo of poolLogos) {
download(`${PATH}/mining-pools/${poolLogo.name}`, poolLogo.download_url);
}
} catch (e) {
console.error(`Unable to download mining pool logos. Trying again at next restart. Reason: ${e instanceof Error ? e.message : e}`);
}
});