Merge branch 'master' into nymkappa/feature/block-api-dynamic-caching

This commit is contained in:
wiz 2022-07-11 11:19:03 +02:00 committed by GitHub
commit e86c5987e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 9 deletions

View file

@ -527,13 +527,12 @@ class Blocks {
}
}
let block = await bitcoinClient.getBlock(hash);
// Not Bitcoin network, return the block as it
if (['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) === false) {
return block;
return await bitcoinApi.$getBlock(hash);
}
let block = await bitcoinClient.getBlock(hash);
block = prepareBlock(block);
// Bitcoin network, add our custom data on top
@ -547,8 +546,8 @@ class Blocks {
return blockExtended;
}
public async $getStrippedBlockTransactions(hash: string, skipMemoryCache: boolean = false,
skipDBLookup: boolean = false): Promise<TransactionStripped[]>
public async $getStrippedBlockTransactions(hash: string, skipMemoryCache = false,
skipDBLookup = false): Promise<TransactionStripped[]>
{
if (skipMemoryCache === false) {
// Check the memory cache

View file

@ -172,7 +172,7 @@ export class Common {
static indexingEnabled(): boolean {
return (
['mainnet', 'testnet', 'signet', 'regtest'].includes(config.MEMPOOL.NETWORK) &&
['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) &&
config.DATABASE.ENABLED === true &&
config.MEMPOOL.INDEXING_BLOCKS_AMOUNT !== 0
);

View file

@ -1,10 +1,10 @@
<div *ngIf="stateService.env.MINING_DASHBOARD || stateService.env.LIGHTNING" class="mb-3 d-flex menu"
style="padding: 0px 35px;">
<a routerLinkActive="active" class="btn btn-primary w-50 mr-1"
<a routerLinkActive="active" class="btn btn-primary mr-1" [class]="padding"
[routerLink]="['/graphs/mempool' | relativeUrl]">Mempool</a>
<div ngbDropdown class="w-50" *ngIf="stateService.env.MINING_DASHBOARD">
<div ngbDropdown class="mr-1" [class]="padding" *ngIf="stateService.env.MINING_DASHBOARD">
<button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="mining">Mining</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/mining/pools' | relativeUrl]"
@ -27,7 +27,7 @@
</div>
</div>
<div ngbDropdown class="w-50" *ngIf="stateService.env.LIGHTNING">
<div ngbDropdown [class]="padding" *ngIf="stateService.env.LIGHTNING">
<button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="lightning">Lightning</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/lightning/nodes-networks' | relativeUrl]"

View file

@ -8,6 +8,8 @@ import { WebsocketService } from "src/app/services/websocket.service";
styleUrls: ['./graphs.component.scss'],
})
export class GraphsComponent implements OnInit {
padding = 'w-50';
constructor(
public stateService: StateService,
private websocketService: WebsocketService
@ -15,5 +17,9 @@ export class GraphsComponent implements OnInit {
ngOnInit(): void {
this.websocketService.want(['blocks']);
if (this.stateService.env.MINING_DASHBOARD === true && this.stateService.env.LIGHTNING === true) {
this.padding = 'w-33';
}
}
}