Skip to content

Commit

Permalink
Fix channel reading
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-wasp committed Apr 1, 2020
1 parent af93afd commit c52c033
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ func (cmd *ExportCommand) Execute() {
log.Infof("Exporting ledgers from %d to %d. Total: %d ledgers\n", cmd.firstLedger, cmd.lastLedger, total)
log.Infof("Will insert %d batches %d ledgers each\n", cmd.blockCount(total), cmd.Config.BatchSize)

channel := stellar.StreamLedgers(cmd.firstLedger, cmd.lastLedger)

for i := 0; i < cmd.blockCount(total); i++ {
var b bytes.Buffer
ledgerCounter := 0
batchNum := i + 1

for meta := range stellar.StreamLedgers(cmd.firstLedger, cmd.lastLedger) {
for meta := range channel {
seq := int(meta.V0.LedgerHeader.Header.LedgerSeq)

if seq < cmd.firstLedger || seq > cmd.lastLedger {
Expand Down

0 comments on commit c52c033

Please sign in to comment.