File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ func NewStore(db *pebble.DB) *Store {
50
50
}
51
51
52
52
func (s * Store ) collectAndWrite (block * database.DBBlock ) error {
53
+ // with current logic channel size is irrelevant as it's not being used
54
+ // we need to untangle bacth collection and the channel length
55
+ // then we can continue computations while
53
56
s .batchSync .Lock ()
54
57
if s .dbBatch == nil {
55
58
s .dbBatch = s .DB .NewBatch ()
@@ -75,7 +78,7 @@ func (s *Store) collectAndWrite(block *database.DBBlock) error {
75
78
s .dbBatch = s .DB .NewBatch ()
76
79
s .batchCounter = 0
77
80
}
78
- err := attachBlcokToBatch (s .dbBatch , block )
81
+ err := attachBlockToBatch (s .dbBatch , block )
79
82
if err != nil {
80
83
logging .L .Err (err ).Msg ("failed to attach to batch" )
81
84
return err
@@ -110,7 +113,7 @@ func (s *Store) commitBatch() error {
110
113
return nil
111
114
}
112
115
113
- func attachBlcokToBatch (batch * pebble.Batch , block * database.DBBlock ) error {
116
+ func attachBlockToBatch (batch * pebble.Batch , block * database.DBBlock ) error {
114
117
blockHash := block .Hash [:]
115
118
txs := block .Txs
116
119
height := block .Height
Original file line number Diff line number Diff line change @@ -175,6 +175,10 @@ func (b *Builder) SyncBlocks(
175
175
logging .L .Info ().
176
176
Uint32 ("height" , syncTip ).
177
177
Msgf ("current indexed chain tip %d" , syncTip )
178
+ logging .L .Info ().
179
+ Int ("backlog_chan_pull" , len (b .newBlockChan )).
180
+ Int ("backlog_chan_db_writer" , len (b .writerChan )).
181
+ Msg ("new_tick_report" )
178
182
case <- tickerReports :
179
183
logging .L .Trace ().
180
184
Int ("backlog_chan_pull" , len (b .newBlockChan )).
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ type ChainInfo struct {
59
59
func GetChainInfo () (* ChainInfo , error ) {
60
60
req , err := http .NewRequest (
61
61
http .MethodGet ,
62
- fmt .Sprintf ("%s/rest/chaininfo.json" , config .RpcEndpoint ),
62
+ fmt .Sprintf ("%s/rest/chaininfo.json" , config .RestEndpoint ),
63
63
nil ,
64
64
)
65
65
if err != nil {
@@ -96,7 +96,7 @@ func GetChainInfo() (*ChainInfo, error) {
96
96
func getBlockHashByHeight (height int64 ) (* chainhash.Hash , error ) {
97
97
req , err := http .NewRequest (
98
98
http .MethodGet ,
99
- fmt .Sprintf ("%s/rest/blockhashbyheight/%d.bin" , config .RpcEndpoint , height ),
99
+ fmt .Sprintf ("%s/rest/blockhashbyheight/%d.bin" , config .RestEndpoint , height ),
100
100
nil ,
101
101
)
102
102
if err != nil {
You can’t perform that action at this time.
0 commit comments