Fix bug in blockconnected notification handler.
If the new minedtx field cannot by type asserted as a []string, keep processing the notification instead of printing an error and returning.
This commit is contained in:
parent
4b7f858bee
commit
b8d7620ced
1 changed files with 10 additions and 12 deletions
22
sockets.go
22
sockets.go
|
@ -344,19 +344,17 @@ func NtfnBlockConnected(r interface{}) {
|
|||
return
|
||||
}
|
||||
height := int64(heightf)
|
||||
iminedTxs, ok := result["minedtxs"].([]interface{})
|
||||
if !ok {
|
||||
log.Error("blockconnected notification: invalid mined tx array")
|
||||
return
|
||||
}
|
||||
minedTxs := make([]string, len(iminedTxs))
|
||||
for i, iminedTx := range iminedTxs {
|
||||
minedTx, ok := iminedTx.(string)
|
||||
if !ok {
|
||||
log.Error("blockconnected notification: mined tx is not a string")
|
||||
continue
|
||||
var minedTxs []string
|
||||
if iminedTxs, ok := result["minedtxs"].([]interface{}); ok {
|
||||
minedTxs = make([]string, len(iminedTxs))
|
||||
for i, iminedTx := range iminedTxs {
|
||||
minedTx, ok := iminedTx.(string)
|
||||
if !ok {
|
||||
log.Error("blockconnected notification: mined tx is not a string")
|
||||
continue
|
||||
}
|
||||
minedTxs[i] = minedTx
|
||||
}
|
||||
minedTxs[i] = minedTx
|
||||
}
|
||||
|
||||
curHeight.Lock()
|
||||
|
|
Loading…
Reference in a new issue