jl777 8 years ago
parent
commit
2cd4194a9f
  1. 2
      basilisk/basilisk.h
  2. 22
      iguana/iguana_interpreter.c
  3. 2
      iguana/tests/decoderawtransactionB

2
basilisk/basilisk.h

@ -16,7 +16,7 @@
#ifndef H_BASILISK_H
#define H_BASILISK_H
//#define BASILISK_DISABLESENDTX
#define BASILISK_DISABLESENDTX
#define BASILISK_DISABLEWAITTX
#include "../iguana/iguana777.h"

22
iguana/iguana_interpreter.c

@ -1337,28 +1337,38 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
}
else if ( (op->flags & IGUANA_CRYPTOFLAG) != 0 )
{
uint8_t rmd160[20]; bits256 hash;
uint8_t rmd160[20],revrmd160[20]; bits256 hash,revhash;
datalen = iguana_databuf(databuf,args[0]);
switch ( op->opcode )
{
case IGUANA_OP_RIPEMD160:
calc_rmd160(0,rmd160,databuf,datalen);
calc_rmd160(0,revrmd160,databuf,datalen);
for (i=0; i<20; i++)
rmd160[i] = revrmd160[19-i];
iguana_pushdata(stacks,0,rmd160,sizeof(rmd160));
break;
case IGUANA_OP_SHA1:
calc_sha1(0,rmd160,databuf,datalen);
calc_sha1(0,revrmd160,databuf,datalen);
for (i=0; i<20; i++)
rmd160[i] = revrmd160[19-i];
iguana_pushdata(stacks,0,rmd160,sizeof(rmd160));
break;
case IGUANA_OP_HASH160:
calc_rmd160_sha256(rmd160,databuf,datalen);
calc_rmd160_sha256(revrmd160,databuf,datalen);
for (i=0; i<20; i++)
rmd160[i] = revrmd160[19-i];
iguana_pushdata(stacks,0,rmd160,sizeof(rmd160));
break;
case IGUANA_OP_SHA256:
vcalc_sha256(0,hash.bytes,databuf,datalen);
vcalc_sha256(0,revhash.bytes,databuf,datalen);
for (i=0; i<32; i++)
hash.bytes[i] = revhash.bytes[31-i];
iguana_pushdata(stacks,0,hash.bytes,sizeof(hash));
break;
case IGUANA_OP_HASH256:
hash = bits256_doublesha256(0,databuf,datalen);
revhash = bits256_doublesha256(0,databuf,datalen);
for (i=0; i<32; i++)
hash.bytes[i] = revhash.bytes[31-i];
iguana_pushdata(stacks,0,hash.bytes,sizeof(hash));
break;
case IGUANA_OP_CHECKSIG: case IGUANA_OP_CHECKSIGVERIFY:

2
iguana/tests/decoderawtransactionB

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"decoderawtransaction\",\"params\":[\"0100000021fde75701151b564fe4e5c316b331838b13600795ac981e99b950d80054c498f5ac5abf7f00000000da483045022100b038ff111f90bb62bfc59ea431c843fb60f54cab13e76cb204b4934c995f06370220466fa43979589e4cf5e9a784f3781a1f7947c14251a385305b79cf2ef86887f801483045022100e7731a9398b82c234a52538943caeaeffc8183b6ec4a42f9fe20b9cc3ba6981902200e285a7a6b3963016900c7dfbfdbc6635bdf9cdae642c9419649a70f8462f214014752210272532a1ce14bc3ee2049584b15e429fac230311f94bb43dd90b69ed3f395ec8d2103868005f78f7cafbf639257ad4173800748053a83418f0f5f472ca5b8efcb637a52aeffffffff01706f9800000000001976a9148ee61a3161993f4f7b7081259bf5f3322d65d3f888ac00000000\"]}"
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"decoderawtransaction\",\"params\":[\"01000000171fe857014a96c1601ac7dde7e9e938576f29231ed4a118b2b5eaaf9bd67c4fba1628ee8200000000d9473044022057a2334780d4d9a3056ad94305cb791a97f93712960d3c28bd0fe7ea1a1e3dde022020d290a335f0256a883e479ce8b094b5825d7255f04e6cc932214338400d159801483045022100d95d280dee78d5898b951333e57a441c36afc22b335d17347be2ed254ed3959102202089f6461c79c056cf4ec168ee0d5e7fba88444faa790110b3ece3c4670db93e0147522102ede537352694a7bd6946dd6a0df6b1a7a9901cc62c4849761c5c3bcef36ce8ec2103e0b630d5cb045e5d3946f7135ef3598e35b07ccb68f55c3491e79f62a9192d8b52aeffffffff01706f9800000000001976a9148ee61a3161993f4f7b7081259bf5f3322d65d3f888ac00000000\"]}"

Loading…
Cancel
Save