Follow specification for FundTransaction RPC.
The specification states that even when the target output amount cannot be reached, all available outputs should still be included in the response and it is up to the caller to check that the target can be satisified or not. Follow this behavior by not erroring when the target was not met.
This commit is contained in:
parent
d2e93f9427
commit
0a9645326d
1 changed files with 0 additions and 4 deletions
|
@ -348,10 +348,6 @@ func (s *walletServer) FundTransaction(ctx context.Context, req *pb.FundTransact
|
|||
|
||||
}
|
||||
|
||||
if req.TargetAmount != 0 && totalAmount < btcutil.Amount(req.TargetAmount) {
|
||||
return nil, errors.New("insufficient output value to reach target")
|
||||
}
|
||||
|
||||
var changeScript []byte
|
||||
if req.IncludeChangeScript && totalAmount > btcutil.Amount(req.TargetAmount) {
|
||||
changeAddr, err := s.wallet.NewChangeAddress(req.Account)
|
||||
|
|
Loading…
Reference in a new issue