Browse Source

test

pull/4/head
jl777 8 years ago
parent
commit
5082453032
  1. 22
      src/komodo_gateway.h
  2. 4
      src/miner.cpp

22
src/komodo_gateway.h

@ -24,16 +24,16 @@ struct pax_transaction
char symbol[4]; uint8_t rmd160[20],shortflag;
};
void komodo_gateway_deposits(CMutableTransaction& txNew)
void komodo_gateway_deposits(CMutableTransaction *txNew)
{
struct pax_transaction *ptr; uint8_t *script,opret[10000],data[10000]; int32_t i,len=0,opretlen=0,numvouts=1;
PENDING_KOMODO_TX = 0;
while ( (ptr= (struct pax_transaction *)queue_dequeue(&DepositsQ)) != 0 )
{
txNew.vout.resize(numvouts+1);
txNew.vout[numvouts].nValue = ptr->fiatoshis;
txNew.vout[numvouts].scriptPubKey.resize(25);
script = (uint8_t *)&txNew.vout[numvouts].scriptPubKey[0];
txNew->vout.resize(numvouts+1);
txNew->vout[numvouts].nValue = ptr->fiatoshis;
txNew->vout[numvouts].scriptPubKey.resize(25);
script = (uint8_t *)&txNew->vout[numvouts].scriptPubKey[0];
*script++ = 0x76;
*script++ = 0xa9;
*script++ = 20;
@ -55,13 +55,13 @@ void komodo_gateway_deposits(CMutableTransaction& txNew)
if ( numvouts > 1 )
{
opretlen = komodo_opreturnscript(opret,'I',data,len);
txNew.vout.resize(numvouts+1);
txNew.vout[numvouts].nValue = 0;
txNew.vout[numvouts].scriptPubKey.resize(opretlen);
script = (uint8_t *)&txNew.vout[numvouts].scriptPubKey[0];
txNew->vout.resize(numvouts+1);
txNew->vout[numvouts].nValue = 0;
txNew->vout[numvouts].scriptPubKey.resize(opretlen);
script = (uint8_t *)&txNew->vout[numvouts].scriptPubKey[0];
memcpy(script,opret,opretlen);
}
printf("total numvouts.%d %.8f\n",numvouts,dstr(PENDING_KOMODO_TX));
printf("total numvouts.%d %.8f opretlen.%d\n",numvouts,dstr(PENDING_KOMODO_TX),opretlen);
} else KOMODO_DEPOSIT = 0;
}
int32_t komodo_check_deposit(const CBlock& block) // verify above block is valid pax pricing

4
src/miner.cpp

@ -99,7 +99,7 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams,
}
int32_t komodo_pax_opreturn(uint8_t *opret,int32_t maxsize);
void komodo_gateway_deposits(CMutableTransaction& txNew);
void komodo_gateway_deposits(CMutableTransaction *txNew);
extern int32_t KOMODO_INITDONE;
extern uint64_t KOMODO_DEPOSIT;
extern char ASSETCHAINS_SYMBOL[16];
@ -374,7 +374,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
}
else
{
komodo_gateway_deposits(txNew);
komodo_gateway_deposits(&txNew);
}
pblock->vtx[0] = txNew;

Loading…
Cancel
Save