mirror of
https://github.com/corda/corda.git
synced 2025-01-18 18:56:28 +00:00
core: Add more info to ClashingThreads exception
This commit is contained in:
parent
ac69f566c9
commit
2d8d5571c2
@ -22,8 +22,8 @@ import javax.annotation.concurrent.ThreadSafe
|
||||
*/
|
||||
@ThreadSafe
|
||||
open class InMemoryWalletService(private val services: ServiceHub) : SingletonSerializeAsToken(), WalletService {
|
||||
class ClashingThreads(threads: Set<SecureHash>) :
|
||||
Exception("There are multiple linear states pointing to the same thread. The clashing thread(s): $threads")
|
||||
class ClashingThreads(threads: Set<SecureHash>, transactions: Iterable<WireTransaction>) :
|
||||
Exception("There are multiple linear head states after processing transactions $transactions. The clashing thread(s): $threads")
|
||||
private val log = loggerFor<InMemoryWalletService>()
|
||||
|
||||
// Variables inside InnerState are protected with a lock by the ThreadBox and aren't in scope unless you're
|
||||
@ -79,7 +79,7 @@ open class InMemoryWalletService(private val services: ServiceHub) : SingletonSe
|
||||
|
||||
val clashingThreads = walletAndNetDelta.first.clashingThreads
|
||||
if (!clashingThreads.isEmpty()) {
|
||||
throw ClashingThreads(clashingThreads)
|
||||
throw ClashingThreads(clashingThreads, txns)
|
||||
}
|
||||
|
||||
wallet = walletAndNetDelta.first
|
||||
|
Loading…
Reference in New Issue
Block a user