mirror of
https://github.com/luxfi/platformvm.git
synced 2026-10-30 15:22:12 +00:00
- Drop atomic_block.go + legacy *_block_test.go (consolidated) - Add block/v0/ subdir + lift_v0.go for old version handling - Copyright header: 'Lux Industries, Inc.' → 'Lux Industries Inc' (no comma) - block_adapter.go: new adapter layer
37 lines
756 B
Go
37 lines
756 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package network
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/luxfi/node/vms/platformvm/txs"
|
|
)
|
|
|
|
var _ TxVerifier = (*LockedTxVerifier)(nil)
|
|
|
|
type TxVerifier interface {
|
|
// VerifyTx verifies that the transaction should be issued into the mempool.
|
|
VerifyTx(tx *txs.Tx) error
|
|
}
|
|
|
|
type LockedTxVerifier struct {
|
|
lock sync.Locker
|
|
txVerifier TxVerifier
|
|
}
|
|
|
|
func (l *LockedTxVerifier) VerifyTx(tx *txs.Tx) error {
|
|
l.lock.Lock()
|
|
defer l.lock.Unlock()
|
|
|
|
return l.txVerifier.VerifyTx(tx)
|
|
}
|
|
|
|
func NewLockedTxVerifier(lock sync.Locker, txVerifier TxVerifier) *LockedTxVerifier {
|
|
return &LockedTxVerifier{
|
|
lock: lock,
|
|
txVerifier: txVerifier,
|
|
}
|
|
}
|