diff --git a/blkmaker_jansson.c b/blkmaker_jansson.c index 709b7a8..8865683 100644 --- a/blkmaker_jansson.c +++ b/blkmaker_jansson.c @@ -163,6 +163,15 @@ const char *parse_txn(struct blktxn_t *txn, json_t *txnj) { } } + txn->weight = -1; + if ((vv = json_object_get(txnj, "weight")) && json_is_number(vv)) { + const double f = json_number_value(txnj); + const int32_t i32 = f; + if (f == i32) { + txn->weight = i32; + } + } + // TODO: dependcount/depends, fee, required, sigops return NULL; diff --git a/blktemplate.h b/blktemplate.h index d3a80c6..f048356 100644 --- a/blktemplate.h +++ b/blktemplate.h @@ -39,6 +39,7 @@ struct blktxn_t { uint64_t fee; bool required; int16_t sigops; + int32_t weight; txnhash_t *hash_; txnhash_t *txid;