mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-20 16:48:40 +02:00
validating transfer type; ready to filter with tx filter
This commit is contained in:
@@ -184,42 +184,11 @@ namespace monero {
|
||||
// if (this.getDestionations() != null && this.getDestionations() != transfer.getDestionations()) return false;
|
||||
}
|
||||
|
||||
// validate type
|
||||
if (inTransfer == nullptr && outTransfer == nullptr) throw runtime_error("Transfer must be MoneroIncomingTransfer or MoneroOutgoingTransfer");
|
||||
|
||||
// // filter on outgoing fields
|
||||
// else if (transfer instanceof MoneroOutgoingTransfer) {
|
||||
// MoneroOutgoingTransfer outTransfer = (MoneroOutgoingTransfer) transfer;
|
||||
//
|
||||
// // filter on addresses
|
||||
// if (this.getAddress() != null && (outTransfer.getAddresses() == null || !outTransfer.getAddresses().contains(this.getAddress()))) return false; // TODO: will filter all transfers if they don't contain addresses
|
||||
// if (this.getAddresses() != null) {
|
||||
// List<String> intersections = new ArrayList<String>(this.getAddresses());
|
||||
// intersections.retainAll(outTransfer.getAddresses());
|
||||
// if (intersections.isEmpty()) return false; // must have overlapping addresses
|
||||
// }
|
||||
//
|
||||
// // filter on subaddress indices
|
||||
// if (this.getSubaddressIndex() != null && (outTransfer.getSubaddressIndices() == null || !outTransfer.getSubaddressIndices().contains(this.getSubaddressIndex()))) return false;
|
||||
// if (this.getSubaddressIndices() != null) {
|
||||
// List<Integer> intersections = new ArrayList<Integer>(this.getSubaddressIndices());
|
||||
// intersections.retainAll(outTransfer.getSubaddressIndices());
|
||||
// if (intersections.isEmpty()) return false; // must have overlapping subaddress indices
|
||||
// }
|
||||
//
|
||||
// // filter on having destinations
|
||||
// if (this.getHasDestinations() != null) {
|
||||
// if (this.getHasDestinations() && outTransfer.getDestinations() == null) return false;
|
||||
// if (!this.getHasDestinations() && outTransfer.getDestinations() != null) return false;
|
||||
// }
|
||||
//
|
||||
// // filter on destinations TODO: start with test for this
|
||||
//// if (this.getDestionations() != null && this.getDestionations() != transfer.getDestionations()) return false;
|
||||
// }
|
||||
//
|
||||
// // otherwise invalid type
|
||||
// else throw new RuntimeException("Transfer must be MoneroIncomingTransfer or MoneroOutgoingTransfer");
|
||||
//
|
||||
// // filter with tx filter
|
||||
// if (this.getTxRequest() != null && !this.getTxRequest().meetsCriteria(transfer.getTx())) return false;
|
||||
// filter with tx filter
|
||||
//if (this.getTxRequest() != null && !this.getTxRequest().meetsCriteria(transfer.getTx())) return false; // TODO
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user