File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -22,25 +22,9 @@ const rpcClient = bitcoin.Client(rpcConfig);
22
22
const latestTimeInSeconds = block . time ;
23
23
const latestTimeDatetime = new Date ( latestTimeInSeconds * 1000 ) . toUTCString ( ) ;
24
24
const latestTimeUTC = latestTimeDatetime . slice ( 0 , - 4 ) ;
25
+ const latestPriceData = await . priceData . getblockCount ( ) ;
25
26
26
27
const yesterdayInSeconds = latestTimeInSeconds - 24 * 60 * 60 ;
27
28
const latestPriceDate = new Date ( yesterdayInSeconds * 1000 ) . toISOString ( ) . slice ( 0 , 10 ) ;
28
29
29
- console . log ( `Connected to local node at block #: ${ blockCount } ` ) ;
30
- console . log ( `Latest available price date is: ${ latestPriceDate } ` ) ;
31
- console . log ( "Earliest available price date is: 2020-07-26 (full node)" ) ;
32
-
33
- // Your date input logic here
34
-
35
- // Rest of the code (Parts 4 to 9) would go here
36
-
37
- } catch ( error ) {
38
- console . error ( "Error connecting to your node. Trouble shooting steps:\n" ) ;
39
- console . error ( "1) Make sure Bitcoin Core is running and reachable." ) ;
40
- console . error ( "2) Make sure you have set up your Bitcoin Core RPC configuration." ) ;
41
- console . error ( "3) Explore the Bitcoin Core RPC options in your JavaScript code." ) ;
42
- console . error ( "\nThe error was:" , error ) ;
43
- process . exit ( 1 ) ;
44
- }
45
- } ) ( ) ;
46
30
You can’t perform that action at this time.
0 commit comments