Revert "Bugfix: Provide correctly-ordered transaction hash (using new key hash_ for backward compatibility)" (broke ABI)
This reverts commit b9572db7d5.
This commit is contained in:
@@ -152,8 +152,6 @@ static bool my_hex2bin(void *o, const char *x, size_t len) {
|
||||
tmpl->skey = true; \
|
||||
} while(0)
|
||||
|
||||
static void my_flip(void *, size_t);
|
||||
|
||||
static
|
||||
const char *parse_txn(struct blktxn_t *txn, json_t *txnj) {
|
||||
json_t *vv;
|
||||
@@ -170,14 +168,12 @@ const char *parse_txn(struct blktxn_t *txn, json_t *txnj) {
|
||||
if ((vv = json_object_get(txnj, "hash")) && json_is_string(vv))
|
||||
{
|
||||
hexdata = json_string_value(vv);
|
||||
txn->hash_ = malloc(sizeof(*txn->hash_));
|
||||
if (!my_hex2bin(*txn->hash_, hexdata, sizeof(*txn->hash_)))
|
||||
txn->hash = malloc(sizeof(*txn->hash));
|
||||
if (!my_hex2bin(*txn->hash, hexdata, sizeof(*txn->hash)))
|
||||
{
|
||||
free(txn->hash_);
|
||||
txn->hash_ = NULL;
|
||||
free(txn->hash);
|
||||
txn->hash = NULL;
|
||||
}
|
||||
else
|
||||
my_flip(*txn->hash_, sizeof(*txn->hash_));
|
||||
}
|
||||
|
||||
// TODO: dependcount/depends, fee, required, sigops
|
||||
|
||||
@@ -97,7 +97,6 @@ static
|
||||
void blktxn_free(struct blktxn_t *bt) {
|
||||
free(bt->data);
|
||||
free(bt->hash);
|
||||
free(bt->hash_);
|
||||
free(bt->depends);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ typedef uint32_t blknonce_t;
|
||||
struct blktxn_t {
|
||||
unsigned char *data;
|
||||
size_t datasz;
|
||||
// NOTE: The byte order of hash is backward; use hash_ instead
|
||||
txnhash_t *hash;
|
||||
|
||||
signed long dependcount;
|
||||
@@ -32,8 +31,6 @@ struct blktxn_t {
|
||||
uint64_t fee;
|
||||
bool required;
|
||||
int16_t sigops;
|
||||
|
||||
txnhash_t *hash_;
|
||||
};
|
||||
|
||||
// BIP 23: Long Polling
|
||||
|
||||
Reference in New Issue
Block a user