From 1e5dd1843df44b2d4705eacce23cfb314a36e3d1 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Thu, 2 Feb 2017 15:51:24 +0000 Subject: [PATCH] Update party match in vault service Replaces the legacy name-only comparison in the vault service with a party comparison. `Party` now has an equals method that only uses the owning key, and therefore this functions as expected. --- core/src/main/kotlin/net/corda/core/node/services/Services.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/kotlin/net/corda/core/node/services/Services.kt b/core/src/main/kotlin/net/corda/core/node/services/Services.kt index 800040174c..8d90ba7c77 100644 --- a/core/src/main/kotlin/net/corda/core/node/services/Services.kt +++ b/core/src/main/kotlin/net/corda/core/node/services/Services.kt @@ -203,8 +203,7 @@ interface VaultService { inline fun VaultService.linearHeadsOfType() = linearHeadsOfType_(T::class.java) inline fun VaultService.dealsWith(party: Party) = linearHeadsOfType().values.filter { - // TODO: Replace name comparison with full party comparison (keys are currenty not equal) - it.state.data.parties.any { it.name == party.name } + it.state.data.parties.any { it == party } } /**