breacharbiter: capitalize "unable to" error msgs

This commit is contained in:
Conner Fromknecht committed 2019-03-19 19:21:03 -07:00
1 parent 6d3b142f2a
commit 3641beb002
1 file changed
+16 -16
+16 -16
View File
@@ -161,7 +161,7 @@ func (b *breachArbiter) Start() error {
// retribution store. // retribution store.
closedChans, err := b.cfg.DB.FetchClosedChannels(false) closedChans, err := b.cfg.DB.FetchClosedChannels(false)
if err != nil { if err != nil {
brarLog.Errorf("unable to fetch closing channels: %v", err) brarLog.Errorf("Unable to fetch closing channels: %v", err)
return err return err
} }
@@ -181,7 +181,7 @@ func (b *breachArbiter) Start() error {
chanPoint := &chanSummary.ChanPoint chanPoint := &chanSummary.ChanPoint
if _, ok := breachRetInfos[*chanPoint]; ok { if _, ok := breachRetInfos[*chanPoint]; ok {
if err := b.cfg.Store.Remove(chanPoint); err != nil { if err := b.cfg.Store.Remove(chanPoint); err != nil {
brarLog.Errorf("unable to remove closed "+ brarLog.Errorf("Unable to remove closed "+
"chanid=%v from breach arbiter: %v", "chanid=%v from breach arbiter: %v",
chanPoint, err) chanPoint, err)
return err return err
@@ -203,7 +203,7 @@ func (b *breachArbiter) Start() error {
&breachTXID, breachScript, 1, retInfo.breachHeight, &breachTXID, breachScript, 1, retInfo.breachHeight,
) )
if err != nil { if err != nil {
brarLog.Errorf("unable to register for conf updates "+ brarLog.Errorf("Unable to register for conf updates "+
"for txid: %v, err: %v", breachTXID, err) "for txid: %v, err: %v", breachTXID, err)
return err return err
} }
@@ -366,8 +366,8 @@ func (b *breachArbiter) waitForSpendEvent(breachInfo *retributionInfo,
breachInfo.breachHeight, breachInfo.breachHeight,
) )
if err != nil { if err != nil {
brarLog.Errorf("unable to check for spentness "+ brarLog.Errorf("Unable to check for spentness "+
"of out_point=%v: %v", "of outpoint=%v: %v",
breachedOutput.outpoint, err) breachedOutput.outpoint, err)
// Registration may have failed if we've been // Registration may have failed if we've been
@@ -492,7 +492,7 @@ func (b *breachArbiter) exactRetribution(confChan *chainntnfs.ConfirmationEvent,
finalTx, err := b.cfg.Store.GetFinalizedTxn(&breachInfo.chanPoint) finalTx, err := b.cfg.Store.GetFinalizedTxn(&breachInfo.chanPoint)
if err != nil { if err != nil {
brarLog.Errorf("unable to get finalized txn for"+ brarLog.Errorf("Unable to get finalized txn for"+
"chanid=%v: %v", &breachInfo.chanPoint, err) "chanid=%v: %v", &breachInfo.chanPoint, err)
return return
} }
@@ -508,7 +508,7 @@ justiceTxBroadcast:
// channel. // channel.
finalTx, err = b.createJusticeTx(breachInfo) finalTx, err = b.createJusticeTx(breachInfo)
if err != nil { if err != nil {
brarLog.Errorf("unable to create justice tx: %v", err) brarLog.Errorf("Unable to create justice tx: %v", err)
return return
} }
@@ -516,7 +516,7 @@ justiceTxBroadcast:
// attempt to broadcast. // attempt to broadcast.
err := b.cfg.Store.Finalize(&breachInfo.chanPoint, finalTx) err := b.cfg.Store.Finalize(&breachInfo.chanPoint, finalTx)
if err != nil { if err != nil {
brarLog.Errorf("unable to finalize justice tx for "+ brarLog.Errorf("Unable to finalize justice tx for "+
"chanid=%v: %v", &breachInfo.chanPoint, err) "chanid=%v: %v", &breachInfo.chanPoint, err)
return return
} }
@@ -530,7 +530,7 @@ justiceTxBroadcast:
// channel's retribution against the cheating counter party. // channel's retribution against the cheating counter party.
err = b.cfg.PublishTransaction(finalTx) err = b.cfg.PublishTransaction(finalTx)
if err != nil { if err != nil {
brarLog.Errorf("unable to broadcast justice tx: %v", err) brarLog.Errorf("Unable to broadcast justice tx: %v", err)
if err == lnwallet.ErrDoubleSpend { if err == lnwallet.ErrDoubleSpend {
// Broadcasting the transaction failed because of a // Broadcasting the transaction failed because of a
@@ -567,7 +567,7 @@ justiceTxBroadcast:
&justiceTXID, justiceScript, 1, breachConfHeight, &justiceTXID, justiceScript, 1, breachConfHeight,
) )
if err != nil { if err != nil {
brarLog.Errorf("unable to register for conf for txid(%v): %v", brarLog.Errorf("Unable to register for conf for txid(%v): %v",
justiceTXID, err) justiceTXID, err)
return return
} }
@@ -605,7 +605,7 @@ justiceTxBroadcast:
// With the channel closed, mark it in the database as such. // With the channel closed, mark it in the database as such.
err := b.cfg.DB.MarkChanFullyClosed(&breachInfo.chanPoint) err := b.cfg.DB.MarkChanFullyClosed(&breachInfo.chanPoint)
if err != nil { if err != nil {
brarLog.Errorf("unable to mark chan as closed: %v", err) brarLog.Errorf("Unable to mark chan as closed: %v", err)
return return
} }
@@ -613,7 +613,7 @@ justiceTxBroadcast:
// retribution info from the database. // retribution info from the database.
err = b.cfg.Store.Remove(&breachInfo.chanPoint) err = b.cfg.Store.Remove(&breachInfo.chanPoint)
if err != nil { if err != nil {
brarLog.Errorf("unable to remove retribution "+ brarLog.Errorf("Unable to remove retribution "+
"from the db: %v", err) "from the db: %v", err)
} }
@@ -672,7 +672,7 @@ func (b *breachArbiter) handleBreachHandoff(breachEvent *ContractBreachEvent) {
breached, err := b.cfg.Store.IsBreached(&chanPoint) breached, err := b.cfg.Store.IsBreached(&chanPoint)
if err != nil { if err != nil {
b.Unlock() b.Unlock()
brarLog.Errorf("unable to check breach info in DB: %v", err) brarLog.Errorf("Unable to check breach info in DB: %v", err)
select { select {
case breachEvent.ProcessACK <- err: case breachEvent.ProcessACK <- err:
@@ -703,7 +703,7 @@ func (b *breachArbiter) handleBreachHandoff(breachEvent *ContractBreachEvent) {
err = b.cfg.Store.Add(retInfo) err = b.cfg.Store.Add(retInfo)
b.Unlock() b.Unlock()
if err != nil { if err != nil {
brarLog.Errorf("unable to persist retribution "+ brarLog.Errorf("Unable to persist retribution "+
"info to db: %v", err) "info to db: %v", err)
} }
@@ -733,7 +733,7 @@ func (b *breachArbiter) handleBreachHandoff(breachEvent *ContractBreachEvent) {
breachTXID, breachScript, 1, retInfo.breachHeight, breachTXID, breachScript, 1, retInfo.breachHeight,
) )
if err != nil { if err != nil {
brarLog.Errorf("unable to register for conf updates for "+ brarLog.Errorf("Unable to register for conf updates for "+
"txid: %v, err: %v", breachTXID, err) "txid: %v, err: %v", breachTXID, err)
return return
} }
@@ -1286,7 +1286,7 @@ func (rs *retributionStore) Remove(chanPoint *wire.OutPoint) error {
// to remove a finalized retribution state that is not already // to remove a finalized retribution state that is not already
// stored in the db. // stored in the db.
if retBucket == nil { if retBucket == nil {
return errors.New("unable to remove retribution " + return errors.New("Unable to remove retribution " +
"because the retribution bucket doesn't exist.") "because the retribution bucket doesn't exist.")
} }