Skip to content

Commit a64d44d

Browse files
committed
feat: allow to filter out conflicting coins
1 parent 8831836 commit a64d44d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/bitcore-node/docs/api-documentation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ curl -v localhost:3000/api/BTC/mainnet/address/12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJ
280280

281281
GET `/api/BTC/mainnet/address/:address/?unspent=true`
282282

283+
**if you want to filter out conflicting utxos, you can add `excludeConflicting=true` to the end of the url.**
284+
283285
<details>
284286
<summary><b>Response</b></summary>
285287
<br>

packages/bitcore-node/src/providers/chain-state/internal/internal.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ export class InternalStateProvider implements IChainStateService {
6969
if (args.unspent) {
7070
query.spentHeight = { $lt: SpentHeightIndicators.minimum };
7171
}
72+
if (args.excludeConflicting) {
73+
query.mintHeight = { $gt: SpentHeightIndicators.conflicting };
74+
}
7275
return query;
7376
}
7477

0 commit comments

Comments
 (0)