Skip to content

Commit b33b958

Browse files
committed
modify lock config
1 parent f6bb017 commit b33b958

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

server/dal.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ func (d *DAL) RefundTransfer(tid, txRefundHash Hash) error {
139139
}
140140

141141
func (d *DAL) RecordTransferIn(tid, txHash Hash) error {
142-
q := `UPDATE transfer SET status = $1, txhash = $2 WHERE tid = $3`
143-
_, err := d.Exec(q, cbn.TransferStatus_TRANSFER_STATUS_LOCKED, txHash.String(), tid.String())
142+
q := `UPDATE transfer SET status = $1, txhash = $2 WHERE tid = $3 and status in ($4,$5)`
143+
_, err := d.Exec(q, cbn.TransferStatus_TRANSFER_STATUS_LOCKED, txHash.String(), tid.String(),
144+
cbn.TransferStatus_TRANSFER_STATUS_TRANSFER_IN_START, cbn.TransferStatus_TRANSFER_STATUS_TRANSFER_IN_PENDING)
144145
return err
145146
}
146147

server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func (s *server) monitorLogTransferOut(bc *bridgeConfig) (monitor.CallbackID, er
389389
}
390390

391391
timeout := int64(ev.Timelock) - tsNow.Unix()
392-
if timeout < (3600 * 23) { // src timeout should be larger than 23 hours
392+
if timeout < 3600*16 { // src timeout should be larger than 16 hours
393393
log.Errorf("src transfer out timeout too small: %d sec", timeout)
394394
return false
395395
}

0 commit comments

Comments
 (0)