add submit check

pull/131/head
Minh Doan 6 years ago
parent 734d2106b0
commit 47056552dc
  1. 2
      .travis.gofmt.sh
  2. 1
      syncing/syncing.go

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if [ -n "$(gofmt -l .)" ]; then if [ -n "$(gofmt -l .)" -o $(golint ./... | wc | awk '{print $1}') -gt "2" ]; then
echo "Go code is not formatted:" echo "Go code is not formatted:"
gofmt -d . gofmt -d .
exit 1 exit 1

@ -265,6 +265,7 @@ func (ss *StateSync) generateStateSyncTaskQueue(bc *blockchain.Blockchain) {
for id, blockHash := range configPeer.blockHashes { for id, blockHash := range configPeer.blockHashes {
if bc.Blocks[id] == nil || !reflect.DeepEqual(bc.Blocks[id].Hash[:], blockHash) { if bc.Blocks[id] == nil || !reflect.DeepEqual(bc.Blocks[id].Hash[:], blockHash) {
ss.stateSyncTaskQueue.Put(SyncBlockTask{index: id, blockHash: blockHash}) ss.stateSyncTaskQueue.Put(SyncBlockTask{index: id, blockHash: blockHash})
// TODO(minhdoan): Check error
} }
} }
break break

Loading…
Cancel
Save