From 0a9645326d1c7d63f3fc4912847602361ea1e39c Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 22 Feb 2016 22:23:33 -0500 Subject: [PATCH] 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. --- rpc/rpcserver/server.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rpc/rpcserver/server.go b/rpc/rpcserver/server.go index e17b4d6..14bbcd7 100644 --- a/rpc/rpcserver/server.go +++ b/rpc/rpcserver/server.go @@ -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)