3 Commits

Autor SHA1 Mensagem Data
  Eric Foster 93c62c8a3b deleted workspace xml 6 anos atrás
  Eric Foster f127226666 updated blockservice mined block by id method 6 anos atrás
  Eric Foster cdbad060db workspace xml and home.ts 6 anos atrás

+ 2
- 2
ZipCoinRedIonicClient/src/pages/home/home.ts Ver arquivo

11
   
11
   
12
   constructor(public navCtrl: NavController, public blockService: BlockService) {
12
   constructor(public navCtrl: NavController, public blockService: BlockService) {
13
       this.getAllBlocks();
13
       this.getAllBlocks();
14
-    }
14
+  }
15
 
15
 
16
   getBlock(id) {
16
   getBlock(id) {
17
     this.blockService.getBlock(id).subscribe(block => {
17
     this.blockService.getBlock(id).subscribe(block => {
26
   getMinedBlock(id) {
26
   getMinedBlock(id) {
27
     this.blockService.getMinedBlock(id).subscribe(minedBlock => {
27
     this.blockService.getMinedBlock(id).subscribe(minedBlock => {
28
       this.block = minedBlock;
28
       this.block = minedBlock;
29
-  })
29
+    })
30
   }
30
   }
31
 }
31
 }
32
 
32
 

+ 1
- 1
ZipCoinRedJavaServer/src/main/java/com/zipcoin/service/BlockService.java Ver arquivo

32
         if (blockToMine.isPresent()) {
32
         if (blockToMine.isPresent()) {
33
             Miner miner = new Miner();
33
             Miner miner = new Miner();
34
             Block minedBlock = miner.mine(blockToMine.get());
34
             Block minedBlock = miner.mine(blockToMine.get());
35
-            return blockRepository.saveAndFlush(minedBlock);
35
+            return blockRepository.save(minedBlock);
36
         } else {
36
         } else {
37
             return null;
37
             return null;
38
         }
38
         }