mirror of
https://github.com/corda/corda.git
synced 2025-01-18 02:39:51 +00:00
Pre-filter states passed to generateSpend()
Pre-filter states passed to generateSpend(), so that requests from the UI to spend cash only ever spend cash with the correct issuer.
This commit is contained in:
parent
8185596224
commit
f9880a4990
@ -173,7 +173,8 @@ class WalletMonitorService(net: MessagingService, val smm: StateMachineManager,
|
||||
// TODO: Have some way of restricting this to states the caller controls
|
||||
try {
|
||||
Cash().generateSpend(builder, Amount(req.pennies, req.tokenDef.product), req.owner,
|
||||
services.walletService.currentWallet.statesOfType<Cash.State>(),
|
||||
// TODO: Move cash state filtering by issuer down to the contract itself
|
||||
services.walletService.currentWallet.statesOfType<Cash.State>().filter { it.state.data.amount.token == req.tokenDef },
|
||||
setOf(req.tokenDef.issuer.party))
|
||||
.forEach {
|
||||
val key = services.keyManagementService.keys[it] ?: throw IllegalStateException("Could not find signing key for ${it.toStringShort()}")
|
||||
|
Loading…
Reference in New Issue
Block a user