OSDN Git Service

Fix the restore issue parallel insert and delete accountutxos
authoricodezjb <icodezjb@163.com>
Fri, 20 Oct 2017 05:25:42 +0000 (13:25 +0800)
committericodezjb <icodezjb@163.com>
Fri, 20 Oct 2017 05:25:42 +0000 (13:25 +0800)
blockchain/pin/pin.go

index d8b70bf..f2a4f4b 100644 (file)
@@ -103,7 +103,7 @@ func (s *Store) LoadAll(ctx context.Context) error {
                }
 
                s.pins[block_processor.Name] = newPin(s.DB,
-                       block_processor.Name[3:],
+                       block_processor.Name,
                        block_processor.Height)
 
        }
@@ -242,12 +242,8 @@ func (p *pin) complete(ctx context.Context, height uint64) error {
                }
        }
 
-       block_processor = struct {
-               Name   string
-               Height uint64
-       }{
-               Name:   p.name,
-               Height: max}
+       block_processor.Name = p.name
+       block_processor.Height = max
 
        bytes, err = json.Marshal(&block_processor)
        if err != nil {