mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 06:35:13 +01:00
add additional info
This commit is contained in:
parent
a6293d21c2
commit
a05212923b
2 changed files with 20 additions and 3 deletions
|
@ -1,6 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.Json;
|
||||
using BTCPayServer.Lightning;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BTCPayApp.CommonServer.Models;
|
||||
|
||||
|
@ -17,6 +20,9 @@ public partial class LightningPayment
|
|||
|
||||
//you can have multiple requests generated for the same payment hash, but once you reveal the preimage, you should reject any attempt to pay the same payment hash
|
||||
public List<string> PaymentRequests { get; set; }
|
||||
[JsonIgnore]
|
||||
public Dictionary<string, JsonDocument> AdditionalData { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class AppUserInfo
|
||||
|
|
|
@ -145,18 +145,29 @@ public class BTCPayAppHub : Hub<IBTCPayAppHubClient>, IBTCPayAppHubServer
|
|||
|
||||
public async Task<decimal> GetFeeRate(int blockTarget)
|
||||
{
|
||||
_logger.LogInformation($"Getting fee rate for {blockTarget}");
|
||||
|
||||
var feeProvider = _feeProviderFactory.CreateFeeProvider( _btcPayNetworkProvider.BTC);
|
||||
return (await feeProvider.GetFeeRateAsync(blockTarget)).SatoshiPerByte;
|
||||
try
|
||||
{
|
||||
|
||||
return (await feeProvider.GetFeeRateAsync(blockTarget)).SatoshiPerByte;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_logger.LogInformation($"Getting fee rate for {blockTarget} done");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<BestBlockResponse> GetBestBlock()
|
||||
{
|
||||
|
||||
_logger.LogInformation($"Getting best block");
|
||||
var explorerClient = _explorerClientProvider.GetExplorerClient( _btcPayNetworkProvider.BTC);
|
||||
var bcInfo = await explorerClient.RPCClient.GetBlockchainInfoAsyncEx();
|
||||
var bh = await GetBlockHeader(bcInfo.BestBlockHash.ToString());
|
||||
|
||||
_logger.LogInformation($"Getting best block done");
|
||||
return new BestBlockResponse()
|
||||
{
|
||||
BlockHash = bcInfo.BestBlockHash.ToString(),
|
||||
|
|
Loading…
Add table
Reference in a new issue