Skip to content

Commit 834729a

Browse files
author
Micah Riggan
committed
Cleanup script
1 parent 0c2edee commit 834729a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { BlockModel } from '../models/block';
2+
import { TransactionModel } from '../models/transaction';
3+
import { CoinModel } from '../models/coin';
4+
import { Storage } from '../services/storage';
5+
6+
Storage.start({}).then(() => {
7+
BlockModel.collection
8+
.find({})
9+
.sort({ height: -1 })
10+
.stream({
11+
transform: async block => {
12+
const txs = await TransactionModel.collection.find({ blockHash: block.hash }).toArray();
13+
for(let tx of txs) {
14+
let mints = await CoinModel.collection.find({ mintTxid: tx.txid }).toArray();
15+
for (let mint of mints) {
16+
if (mint.mintHeight != block.height && block.height > mint.mintHeight) {
17+
console.log(mint);
18+
}
19+
}
20+
}
21+
}
22+
})
23+
});

0 commit comments

Comments
 (0)