fixes deferred loading of Tx when being referenced

This commit is contained in:
eyck committed 2023-03-18 12:18:20 +01:00
1 parent f9d38b5091
commit 6f2f5a388c
3 files changed
+105 -16

No files matched your search

@@ -71,6 +71,18 @@ class TxStream extends AbstractTxStream {
return chunks;
}
public void loadStream() {
try {
List<byte[]> chunks = getChunks();
int blockid = 0;
for (byte[] bs : chunks) {
loader.parseTx(this, blockid, bs);
blockid++;
}
} catch (InputFormatException e) {
} catch (IOException e) {
}
}
/**
* Gets the events.
*
@@ -79,17 +91,9 @@ class TxStream extends AbstractTxStream {
@Override
public IEventList getEvents() {
if(events.size()==0) {
try {
List<byte[]> chunks = getChunks();
int blockid = 0;
for (byte[] bs : chunks) {
loader.parseTx(this, blockid, bs);
blockid++;
}
} catch (InputFormatException e) {
} catch (IOException e) {
}
loadStream();
}
return events;
}
}