mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-06 06:06:49 +00:00
[NOD-427] Selected tip notification (#494)
* [NOD-427] Send notifications to `dag/selected-tip` * [NOD-442] Add selected tip notification * [NOD-427] Add comment to PublishSelectedTipNotification * [NOD-427] Remove redundant argument from errors.Wrapf * [NOD-427] Add handleBlockAddedMsg function * [NOD-427] Return errors instead of panicking * [NOD-427] Fix findHashOfBluestBlock to use []string instead of dbmodels.Block * [NOD-427] Add constants * [NOD-427] use path.Join instead of topic+address * [NOD-427] Remove redundant select * [NOD-427] Change break to return * [NOD-427] Fix findHashOfBluestBlock to handle empty blocks table * [NOD-427] Return httpserverutils.HasDBError(dbErrors)
This commit is contained in:
parent
532e57b61c
commit
0c9e55a358
@ -181,7 +181,7 @@ func findHashOfBluestBlock(mustBeChainBlock bool) (*string, error) {
|
||||
if httpserverutils.HasDBError(dbErrors) {
|
||||
return nil, httpserverutils.NewErrorFromDBErrors("failed to find hash of bluest block: ", dbErrors)
|
||||
}
|
||||
if httpserverutils.IsDBRecordNotFoundError(dbErrors) {
|
||||
if len(blockHashes) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return &blockHashes[0], nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user