Skip to content

Conversation

@StanleyDing
Copy link
Contributor

No description provided.


for addr, color_amount_map in addr_in_map.items():
utxos = get_rpc_connection().gettxoutaddress(addr)
for color, amount in color_amount_map.items():
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果color是1且這個addr=fee_address可能會有問題,color 1其實不夠,選到重複的utxo

for color, amount in color_amount_map.items():
outs = [{'address': addr, 'value': int(amount * 10**8), 'color': color}]

raw_tx = make_raw_tx(ins, outs)
Copy link

@Jsying Jsying Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ins裡的utxo的amount應該大於或等於outs的amount。這邊要算找錢

addr2_in = addr_in_map.setdefault(tx['address2'], {})
addr2_in[tx['color2']] = addr1_in.get(tx['color2'], 0) + tx['amount2']

addr1_out = addr_out_map.setdefault(tx['address1'], {})
Copy link

@Jsying Jsying Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

希望vouts不要加起來,才有辦法在transaction裡,看到比較清楚的交換內容。

Exchange API is not limited to exchange between 2 address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants