Simplify comparisons

len(byte[][]) is defined as zero when the value is nil
This commit is contained in:
Pavol Rusnak 2022-06-11 22:09:45 +02:00 committed by Martin
parent e87ffec75c
commit 34499406cf
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ func (mq *MQ) run(callback func(NotificationType)) {
} else {
repeatedError = false
}
if msg != nil && len(msg) >= 3 {
if len(msg) >= 3 {
var nt NotificationType
switch string(msg[0]) {
case "hashblock":

View File

@ -188,7 +188,7 @@ func (c *fakeBlockChain) GetTransactionForMempool(txid string) (v *bchain.Tx, er
}
func (c *fakeBlockChain) EstimateSmartFee(blocks int, conservative bool) (v big.Int, err error) {
if conservative == false {
if !conservative {
v.SetInt64(int64(blocks)*100 - 1)
} else {
v.SetInt64(int64(blocks) * 100)