File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
packages/bitcore-node/src/utils Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments