From 5e9343a66233b3f1b14a5b5e8d38c94a917e7811 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Tue, 27 Oct 2020 10:44:57 -0700 Subject: [PATCH] Set historical balance lookup to true in services --- main.go | 2 +- services/network_service.go | 7 ++++--- services/network_service_test.go | 7 ++++--- services/types.go | 4 ++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index 8271f45..4b5d1c6 100644 --- a/main.go +++ b/main.go @@ -154,7 +154,7 @@ func main() { // requests. asserter, err := asserter.NewServer( bitcoin.OperationTypes, - true, + services.HistoricalBalanceLookup, []*types.NetworkIdentifier{cfg.Network}, nil, ) diff --git a/services/network_service.go b/services/network_service.go index 876c6d2..edeb721 100644 --- a/services/network_service.go +++ b/services/network_service.go @@ -95,9 +95,10 @@ func (s *NetworkAPIService) NetworkOptions( MiddlewareVersion: &MiddlewareVersion, }, Allow: &types.Allow{ - OperationStatuses: bitcoin.OperationStatuses, - OperationTypes: bitcoin.OperationTypes, - Errors: Errors, + OperationStatuses: bitcoin.OperationStatuses, + OperationTypes: bitcoin.OperationTypes, + Errors: Errors, + HistoricalBalanceLookup: HistoricalBalanceLookup, }, }, nil } diff --git a/services/network_service_test.go b/services/network_service_test.go index 4101b35..8854cbf 100644 --- a/services/network_service_test.go +++ b/services/network_service_test.go @@ -35,9 +35,10 @@ var ( MiddlewareVersion: &middlewareVersion, }, Allow: &types.Allow{ - OperationStatuses: bitcoin.OperationStatuses, - OperationTypes: bitcoin.OperationTypes, - Errors: Errors, + OperationStatuses: bitcoin.OperationStatuses, + OperationTypes: bitcoin.OperationTypes, + Errors: Errors, + HistoricalBalanceLookup: HistoricalBalanceLookup, }, } diff --git a/services/types.go b/services/types.go index e5b881e..b753d39 100644 --- a/services/types.go +++ b/services/types.go @@ -26,6 +26,10 @@ const ( // NodeVersion is the version of // bitcoin core we are using. NodeVersion = "0.20.1" + + // HistoricalBalanceLookup indicates + // that historical balance lookup is supported. + HistoricalBalanceLookup = true ) var (