aboutsummaryrefslogtreecommitdiffstats
path: root/block_manager.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2013-12-29 08:36:59 +0800
committerobscuren <obscuren@obscura.com>2013-12-29 08:36:59 +0800
commita1c5d5acac542ab877aeec7814338e7638d55dbf (patch)
treec194057a1662326dc17424b09c6c986c9cfd4669 /block_manager.go
parent5198b7b9ebdfe1ef99627dadb07b87e18a039972 (diff)
downloadgo-tangerine-a1c5d5acac542ab877aeec7814338e7638d55dbf.tar
go-tangerine-a1c5d5acac542ab877aeec7814338e7638d55dbf.tar.gz
go-tangerine-a1c5d5acac542ab877aeec7814338e7638d55dbf.tar.bz2
go-tangerine-a1c5d5acac542ab877aeec7814338e7638d55dbf.tar.lz
go-tangerine-a1c5d5acac542ab877aeec7814338e7638d55dbf.tar.xz
go-tangerine-a1c5d5acac542ab877aeec7814338e7638d55dbf.tar.zst
go-tangerine-a1c5d5acac542ab877aeec7814338e7638d55dbf.zip
Comments
Diffstat (limited to 'block_manager.go')
-rw-r--r--block_manager.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/block_manager.go b/block_manager.go
index 80b30eff6..a60d4340d 100644
--- a/block_manager.go
+++ b/block_manager.go
@@ -26,9 +26,12 @@ func NewBlockManager() *BlockManager {
// Process a block.
func (bm *BlockManager) ProcessBlock(block *Block) error {
+ // Get the tx count. Used to create enough channels to 'join' the go routines
txCount := len(block.transactions)
+ // Locking channel. When it has been fully buffered this method will return
lockChan := make(chan bool, txCount)
+ // Process each transaction/contract
for _, tx := range block.transactions {
go bm.ProcessTransaction(tx, lockChan)
}