Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-mempool
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain-mempool
Commits
0b33d3f3
Unverified
Commit
0b33d3f3
authored
5 years ago
by
Aleksandr Lysikov
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2 from kelvinblockchain/master
master->feature2272
parents
34fdd108
ef124147
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap_chain_mempool.c
+3
-3
3 additions, 3 deletions
dap_chain_mempool.c
dap_chain_mempool.h
+6
-0
6 additions, 0 deletions
dap_chain_mempool.h
with
9 additions
and
3 deletions
dap_chain_mempool.c
+
3
−
3
View file @
0b33d3f3
...
...
@@ -204,7 +204,7 @@ int dap_chain_mempool_tx_create(dap_enc_key_t *a_key_from,
DAP_DELETE
(
l_tx
);
char
*
l_key_str
=
dap_chain_hash_fast_to_str_new
(
&
l_key_hash
);
if
(
dap_chain_global_db_gr_set
(
l_key_str
,
(
uint8_t
*
)
l_datum
,
dap_chain_datum_
data_
size
(
l_datum
)
if
(
dap_chain_global_db_gr_set
(
l_key_str
,
(
uint8_t
*
)
l_datum
,
dap_chain_datum_size
(
l_datum
)
,
c_dap_datum_mempool_gdb_group
))
{
log_it
(
L_NOTICE
,
"Transaction %s placed in mempool"
,
l_key_str
);
// add transaction to utxo
...
...
@@ -351,7 +351,7 @@ uint8_t* dap_datum_mempool_serialize(dap_datum_mempool_t *datum_mempool, size_t
{
size_t
a_request_size
=
2
*
sizeof
(
uint16_t
),
shift_size
=
0
;
for
(
int
i
=
0
;
i
<
datum_mempool
->
datum_count
;
i
++
)
{
a_request_size
+=
dap_chain_datum_
data_
size
(
datum_mempool
->
data
[
i
])
+
sizeof
(
uint16_t
);
a_request_size
+=
dap_chain_datum_size
(
datum_mempool
->
data
[
i
])
+
sizeof
(
uint16_t
);
}
uint8_t
*
a_request
=
DAP_NEW_SIZE
(
uint8_t
,
a_request_size
);
memcpy
(
a_request
+
shift_size
,
&
(
datum_mempool
->
version
),
sizeof
(
uint16_t
));
...
...
@@ -359,7 +359,7 @@ uint8_t* dap_datum_mempool_serialize(dap_datum_mempool_t *datum_mempool, size_t
memcpy
(
a_request
+
shift_size
,
&
(
datum_mempool
->
datum_count
),
sizeof
(
uint16_t
));
shift_size
+=
sizeof
(
uint16_t
);
for
(
int
i
=
0
;
i
<
datum_mempool
->
datum_count
;
i
++
)
{
size_t
size_one
=
dap_chain_datum_
data_
size
(
datum_mempool
->
data
[
i
]);
size_t
size_one
=
dap_chain_datum_size
(
datum_mempool
->
data
[
i
]);
memcpy
(
a_request
+
shift_size
,
&
size_one
,
sizeof
(
uint16_t
));
shift_size
+=
sizeof
(
uint16_t
);
memcpy
(
a_request
+
shift_size
,
datum_mempool
->
data
[
i
],
size_one
);
...
...
This diff is collapsed.
Click to expand it.
dap_chain_mempool.h
+
6
−
0
View file @
0b33d3f3
...
...
@@ -45,4 +45,10 @@ int dap_chain_mempool_tx_create(dap_enc_key_t *a_key_from,
const
char
a_token_ticker
[
10
],
uint64_t
a_value
,
uint64_t
a_value_fee
);
int
dap_chain_mempool_tx_create_cond
(
dap_enc_key_t
*
a_key_from
,
dap_enc_key_t
*
a_key_cond
,
const
dap_chain_addr_t
*
a_addr_from
,
const
dap_chain_addr_t
*
a_addr_cond
,
const
dap_chain_addr_t
*
a_addr_fee
,
const
char
a_token_ticker
[
10
],
uint64_t
a_value
,
uint64_t
a_value_fee
,
const
void
*
a_cond
,
size_t
a_cond_size
);
int
dap_chain_mempool_datum_add
(
dap_chain_datum_t
*
a_datum
);
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