Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
31d51df2
Commit
31d51df2
authored
6 years ago
by
Moul
Committed by
Mael
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[mod]
#184
: Do no longer pass allSources/all_input variable trough…
… all transaction f().
parent
58dcbbb7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
silkaj/tx.py
+6
-25
6 additions, 25 deletions
silkaj/tx.py
with
6 additions
and
25 deletions
silkaj/tx.py
+
6
−
25
View file @
31d51df2
...
...
@@ -86,13 +86,7 @@ async def send_transaction(
==
"
yes
"
):
await
generate_and_send_transaction
(
key
,
issuer_pubkey
,
tx_amount
,
outputAddresses
,
comment
,
allsources
,
outputbackchange
,
key
,
issuer_pubkey
,
tx_amount
,
outputAddresses
,
comment
,
outputbackchange
)
...
...
@@ -174,19 +168,12 @@ async def transaction_confirmation(
async
def
generate_and_send_transaction
(
key
,
issuers
,
AmountTransfered
,
outputAddresses
,
Comment
=
""
,
all_input
=
False
,
OutputbackChange
=
None
,
key
,
issuers
,
AmountTransfered
,
outputAddresses
,
Comment
=
""
,
OutputbackChange
=
None
):
client
=
ClientInstance
().
client
while
True
:
listinput_and_amount
=
await
get_list_input_for_transaction
(
issuers
,
AmountTransfered
*
len
(
outputAddresses
)
,
all_input
issuers
,
AmountTransfered
*
len
(
outputAddresses
)
)
intermediatetransaction
=
listinput_and_amount
[
2
]
...
...
@@ -221,13 +208,7 @@ async def generate_and_send_transaction(
print
(
"
- From:
"
+
issuers
)
for
outputAddress
in
outputAddresses
:
print
(
"
- To:
"
+
outputAddress
)
if
all_input
:
print
(
"
- Amount:
"
+
str
(
listinput_and_amount
[
1
]
/
100
))
else
:
print
(
"
- Amount:
"
+
str
(
AmountTransfered
/
100
*
len
(
outputAddresses
))
)
print
(
"
- Amount:
"
+
str
(
AmountTransfered
/
100
*
len
(
outputAddresses
)))
transaction
=
await
generate_transaction_document
(
issuers
,
AmountTransfered
,
...
...
@@ -336,7 +317,7 @@ def generate_output(listoutput, unitbase, rest, recipient_address):
unitbase
=
unitbase
-
1
async
def
get_list_input_for_transaction
(
pubkey
,
TXamount
,
allinput
=
False
):
async
def
get_list_input_for_transaction
(
pubkey
,
TXamount
):
listinput
,
amount
=
await
get_sources
(
pubkey
)
# generate final list source
...
...
@@ -351,7 +332,7 @@ async def get_list_input_for_transaction(pubkey, TXamount, allinput=False):
if
len
(
listinputfinal
)
>=
40
:
intermediatetransaction
=
True
break
if
TXamount
<=
0
and
not
allinput
:
if
TXamount
<=
0
:
break
if
TXamount
>
0
and
not
intermediatetransaction
:
message_exit
(
"
Error: you don
'
t have enough money
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment