mirror of
https://github.com/corda/corda.git
synced 2025-03-25 13:27:58 +00:00
BIGINT fix for H2 coin selection. (#1658)
* BIGINT fix for H2 coin selection. * Review feedback
This commit is contained in:
parent
7b94f771b9
commit
cd5088cc8b
@ -77,7 +77,7 @@ class CashSelectionH2Impl : CashSelection {
|
||||
spendLock.withLock {
|
||||
val statement = services.jdbcSession().createStatement()
|
||||
try {
|
||||
statement.execute("CALL SET(@t, 0);")
|
||||
statement.execute("CALL SET(@t, CAST(0 AS BIGINT));")
|
||||
|
||||
// we select spendable states irrespective of lock but prioritised by unlocked ones (Eg. null)
|
||||
// the softLockReserve update will detect whether we try to lock states locked by others
|
||||
|
@ -44,17 +44,17 @@ private class TraderDemo {
|
||||
}
|
||||
|
||||
// What happens next depends on the role. The buyer sits around waiting for a trade to start. The seller role
|
||||
// will contact the buyer and actually make something happen.
|
||||
// will contact the buyer and actually make something happen. We intentionally use large amounts here.
|
||||
val role = options.valueOf(roleArg)!!
|
||||
if (role == Role.BANK) {
|
||||
val bankHost = NetworkHostAndPort("localhost", bankRpcPort)
|
||||
CordaRPCClient(bankHost).use("demo", "demo") {
|
||||
TraderDemoClientApi(it.proxy).runIssuer(1100.DOLLARS, buyerName, sellerName)
|
||||
TraderDemoClientApi(it.proxy).runIssuer(1_100_000_000.DOLLARS, buyerName, sellerName)
|
||||
}
|
||||
} else {
|
||||
val sellerHost = NetworkHostAndPort("localhost", sellerRpcPort)
|
||||
CordaRPCClient(sellerHost).use("demo", "demo") {
|
||||
TraderDemoClientApi(it.proxy).runSeller(1000.DOLLARS, buyerName)
|
||||
TraderDemoClientApi(it.proxy).runSeller(1_000_000_000.DOLLARS, buyerName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user