diff options
author | obscuren <obscuren@obscura.com> | 2013-12-29 08:36:59 +0800 |
---|---|---|
committer | obscuren <obscuren@obscura.com> | 2013-12-29 08:36:59 +0800 |
commit | a1c5d5acac542ab877aeec7814338e7638d55dbf (patch) | |
tree | c194057a1662326dc17424b09c6c986c9cfd4669 /block_manager.go | |
parent | 5198b7b9ebdfe1ef99627dadb07b87e18a039972 (diff) | |
download | go-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.go | 3 |
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) } |