File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ func sendRawTransaction(msgtx *wire.MsgTx) (*wire.ShaHash, error) {
246246 if err := msgtx .BtcEncode (& buf , wire .ProtocolVersion ); err != nil {
247247 // Hitting OOM by growing or writing to a bytes.Buffer already
248248 // panics, and all returned errors are unexpected.
249- //panic(err)
249+ //panic(err)
250250 //TODO: should we have retry logic?
251251 return nil , err
252252 }
@@ -319,16 +319,21 @@ func createBtcdNotificationHandlers() btcrpcclient.NotificationHandlers {
319319func InitAnchor (ldb database.Db ) {
320320 anchorLog .Debug ("InitAnchor" )
321321 db = ldb
322- dirBlockInfoMap , _ = db .FetchAllUnconfirmedDirBlockInfo ()
322+ var err error
323+ dirBlockInfoMap , err = db .FetchAllUnconfirmedDirBlockInfo ()
324+ if err != nil {
325+ anchorLog .Error ("InitAnchor error - " + err .Error ())
326+ return
327+ }
323328
324- if err : = initRPCClient (); err != nil {
329+ if err = initRPCClient (); err != nil {
325330 anchorLog .Error (err .Error ())
326331 return
327332 }
328333 //defer shutdown(dclient)
329334 //defer shutdown(wclient)
330335
331- if err : = initWallet (); err != nil {
336+ if err = initWallet (); err != nil {
332337 anchorLog .Error (err .Error ())
333338 return
334339 }
Original file line number Diff line number Diff line change @@ -435,7 +435,8 @@ func (db *LevelDb) FetchAllUnconfirmedDirBlockInfo() (dirBlockInfoMap map[string
435435 if iter .Value ()[len (iter .Value ())- 1 ] == 0 {
436436 _ , err := dBInfo .UnmarshalBinaryData (iter .Value ())
437437 if err != nil {
438- return nil , err
438+ //TODO: FIXME: return nil, err , rather than an incomplete map; fix the underlying problem
439+ return dirBlockInfoMap , err
439440 }
440441 dirBlockInfoMap [dBInfo .DBMerkleRoot .String ()] = dBInfo
441442 }
You can’t perform that action at this time.
0 commit comments