X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=account%2Futxo_keeper.go;fp=account%2Futxo_keeper.go;h=ed4d685cc3e7ea9dd792bcfcfc648ed5ab440230;hp=cd9beea656c15de3335ae75fea54bb3f4c8f25c3;hb=5050ec8a8ac00351713b219bc897eafc1bfd6293;hpb=1ad7f11283cdf5ad9e254f2bb901a6032ee3e715 diff --git a/account/utxo_keeper.go b/account/utxo_keeper.go index cd9beea6..ed4d685c 100644 --- a/account/utxo_keeper.go +++ b/account/utxo_keeper.go @@ -22,6 +22,7 @@ const desireUtxoCount = 5 var ( ErrInsufficient = errors.New("reservation found insufficient funds") ErrImmature = errors.New("reservation found immature funds") + ErrVoteLock = errors.New("Locked by the vote") ErrReserved = errors.New("reservation found outputs already reserved") ErrMatchUTXO = errors.New("can't find utxo with given hash") ErrReservation = errors.New("couldn't find reservation") @@ -124,6 +125,9 @@ func (uk *utxoKeeper) Reserve(accountID string, assetID *bc.AssetID, amount uint } if optAmount+reservedAmount < amount { + if vote != nil { + return nil, ErrVoteLock + } return nil, ErrImmature }