Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
matograine
silkaj
Commits
60424c9c
Commit
60424c9c
authored
Mar 20, 2019
by
Moul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mod] tx: create SOURCES_PER_TX constant
in order to play with intermediaries tx
parent
651709cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
silkaj/constants.py
silkaj/constants.py
+1
-0
silkaj/tx.py
silkaj/tx.py
+3
-3
No files found.
silkaj/constants.py
View file @
60424c9c
...
...
@@ -22,3 +22,4 @@ GTEST_SYMBOL = "ĞTest"
G1_DEFAULT_ENDPOINT
=
"g1.duniter.org"
,
"443"
G1_TEST_DEFAULT_ENDPOINT
=
"g1-test.duniter.org"
,
"443"
CONNECTION_TIMEOUT
=
10
SOURCES_PER_TX
=
40
silkaj/tx.py
View file @
60424c9c
...
...
@@ -32,7 +32,7 @@ from silkaj.money import (
UDValue
,
amount_in_current_base
,
)
from
silkaj.constants
import
NO_MATCHING_ID
from
silkaj.constants
import
NO_MATCHING_ID
,
SOURCES_PER_TX
from
duniterpy.api.bma.tx
import
process
from
duniterpy.documents
import
BlockUID
,
Transaction
...
...
@@ -193,8 +193,8 @@ async def get_list_input_for_transaction(pubkey, TXamount):
listinputfinal
.
append
(
input
)
totalAmountInput
+=
amount_in_current_base
(
input
)
TXamount
-=
amount_in_current_base
(
input
)
# if more 40 sources, it's an intermediate transaction
if
len
(
listinputfinal
)
>=
40
:
# if more
than
40 sources, it's an intermediate transaction
if
len
(
listinputfinal
)
>=
SOURCES_PER_TX
:
intermediatetransaction
=
True
break
if
TXamount
<=
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment