Merge branch 'master' into nymkappa/feature/block-api-dynamic-caching
This commit is contained in:
commit
e86c5987e3
@ -527,13 +527,12 @@ class Blocks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let block = await bitcoinClient.getBlock(hash);
|
|
||||||
|
|
||||||
// Not Bitcoin network, return the block as it
|
// Not Bitcoin network, return the block as it
|
||||||
if (['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) === false) {
|
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);
|
block = prepareBlock(block);
|
||||||
|
|
||||||
// Bitcoin network, add our custom data on top
|
// Bitcoin network, add our custom data on top
|
||||||
@ -547,8 +546,8 @@ class Blocks {
|
|||||||
return blockExtended;
|
return blockExtended;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async $getStrippedBlockTransactions(hash: string, skipMemoryCache: boolean = false,
|
public async $getStrippedBlockTransactions(hash: string, skipMemoryCache = false,
|
||||||
skipDBLookup: boolean = false): Promise<TransactionStripped[]>
|
skipDBLookup = false): Promise<TransactionStripped[]>
|
||||||
{
|
{
|
||||||
if (skipMemoryCache === false) {
|
if (skipMemoryCache === false) {
|
||||||
// Check the memory cache
|
// Check the memory cache
|
||||||
|
@ -172,7 +172,7 @@ export class Common {
|
|||||||
|
|
||||||
static indexingEnabled(): boolean {
|
static indexingEnabled(): boolean {
|
||||||
return (
|
return (
|
||||||
['mainnet', 'testnet', 'signet', 'regtest'].includes(config.MEMPOOL.NETWORK) &&
|
['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK) &&
|
||||||
config.DATABASE.ENABLED === true &&
|
config.DATABASE.ENABLED === true &&
|
||||||
config.MEMPOOL.INDEXING_BLOCKS_AMOUNT !== 0
|
config.MEMPOOL.INDEXING_BLOCKS_AMOUNT !== 0
|
||||||
);
|
);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<div *ngIf="stateService.env.MINING_DASHBOARD || stateService.env.LIGHTNING" class="mb-3 d-flex menu"
|
<div *ngIf="stateService.env.MINING_DASHBOARD || stateService.env.LIGHTNING" class="mb-3 d-flex menu"
|
||||||
style="padding: 0px 35px;">
|
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>
|
[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>
|
<button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="mining">Mining</button>
|
||||||
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
|
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
|
||||||
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/mining/pools' | relativeUrl]"
|
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/mining/pools' | relativeUrl]"
|
||||||
@ -27,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
<button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="lightning">Lightning</button>
|
||||||
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
|
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
|
||||||
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/lightning/nodes-networks' | relativeUrl]"
|
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/lightning/nodes-networks' | relativeUrl]"
|
||||||
|
@ -8,6 +8,8 @@ import { WebsocketService } from "src/app/services/websocket.service";
|
|||||||
styleUrls: ['./graphs.component.scss'],
|
styleUrls: ['./graphs.component.scss'],
|
||||||
})
|
})
|
||||||
export class GraphsComponent implements OnInit {
|
export class GraphsComponent implements OnInit {
|
||||||
|
padding = 'w-50';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public stateService: StateService,
|
public stateService: StateService,
|
||||||
private websocketService: WebsocketService
|
private websocketService: WebsocketService
|
||||||
@ -15,5 +17,9 @@ export class GraphsComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.websocketService.want(['blocks']);
|
this.websocketService.want(['blocks']);
|
||||||
|
|
||||||
|
if (this.stateService.env.MINING_DASHBOARD === true && this.stateService.env.LIGHTNING === true) {
|
||||||
|
this.padding = 'w-33';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user