Merge pull request #409 from clark800/counterparty

Add counterparty option to getTransactions
This commit is contained in:
Chris Clark
2015-07-09 14:59:10 -07:00
2 changed files with 5 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
"excludeFailures": {"type": "boolean"},
"outgoing": {"type": "boolean"},
"incoming": {"type": "boolean"},
"counterparty": {"$ref": "address"},
"types": {
"type": "array",
"items": {

View File

@@ -27,6 +27,10 @@ function transactionFilter(address, filters, tx) {
if (filters.incoming && tx.address === address) {
return false;
}
if (filters.counterparty && tx.address !== filters.counterparty
&& tx.Destination !== filters.counterparty) {
return false;
}
return true;
}