-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement exchange API. #77
base: develop
Are you sure you want to change the base?
Conversation
|
||
for addr, color_amount_map in addr_in_map.items(): | ||
utxos = get_rpc_connection().gettxoutaddress(addr) | ||
for color, amount in color_amount_map.items(): |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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'], {}) |
There was a problem hiding this comment.
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.
435f2ce
to
5007e92
Compare
No description provided.