mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 05:04:35 +00:00
ensure only wallet owned p2pkh addresses are passed in
This commit is contained in:
parent
bbf0943003
commit
3e2eb2a7c7
1 changed files with 12 additions and 2 deletions
|
@ -80,9 +80,19 @@ mixin FusionWalletInterface {
|
|||
// set _uiState states
|
||||
}
|
||||
|
||||
/// Returns a list of all addresses in the wallet.
|
||||
/// Returns a list of all owned p2pkh addresses in the wallet.
|
||||
Future<List<fusion.Address>> getFusionAddresses() async {
|
||||
List<Address> _addresses = await _db.getAddresses(_walletId).findAll();
|
||||
List<Address> _addresses = await _db
|
||||
.getAddresses(_walletId)
|
||||
.filter()
|
||||
.typeEqualTo(AddressType.p2pkh)
|
||||
.and()
|
||||
.group((q) => q
|
||||
.subTypeEqualTo(AddressSubType.receiving)
|
||||
.or()
|
||||
.subTypeEqualTo(AddressSubType.change))
|
||||
.findAll();
|
||||
|
||||
return _addresses.map((address) => address.toFusionAddress()).toList();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue