Skip to content

Commit b505004

Browse files
committed
Support explicit change outputs
For example: $ green-cli tx outputs add $ADDR change Allows specifying a single explicit change output that will act as a sink for any amount left over after paying the other outputs and fee. In the absence of an explicit change output the gdk will generate a single change output.
1 parent daffa57 commit b505004

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

green_cli/param_types.py

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ def convert(self, value, param, ctx):
3232
# level. gdk only allows one addressee with send all
3333
ctx.params['details']['send_all'] = True
3434
value = 0
35+
elif value == "change":
36+
# Explicit change output
37+
ctx.params['details']['addressees'][-1]['is_change'] = True
38+
value = 0
3539
else:
3640
value = self.value2sat(value)
3741

0 commit comments

Comments
 (0)