Skip to content

Commit

Permalink
Follow specification for FundTransaction RPC.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrick committed Feb 23, 2016
1 parent d2e93f9 commit 0a96453
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions rpc/rpcserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0a96453

Please sign in to comment.