Revert Getscriptaddress and set COINBASE_MATURITY to 1 on chains with less than one era
This commit is contained in:
@@ -188,16 +188,13 @@ void CCaddr3set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *
|
|||||||
|
|
||||||
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey)
|
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey)
|
||||||
{
|
{
|
||||||
CTxDestination address;
|
CTxDestination address; txnouttype whichType;
|
||||||
txnouttype whichType;
|
if ( ExtractDestination(scriptPubKey,address) != 0 )
|
||||||
std::vector<std::vector<unsigned char>> vvch = std::vector<std::vector<unsigned char>>();
|
|
||||||
if (Solver(scriptPubKey, whichType, vvch) && vvch[0].size() == 20)
|
|
||||||
{
|
{
|
||||||
address = CKeyID(uint160(vvch[0]));
|
|
||||||
strcpy(destaddr,(char *)CBitcoinAddress(address).ToString().c_str());
|
strcpy(destaddr,(char *)CBitcoinAddress(address).ToString().c_str());
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
fprintf(stderr,"Solver for scriptPubKey failed\n%s\n", scriptPubKey.ToString().c_str());
|
//fprintf(stderr,"ExtractDestination failed\n");
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1916,7 +1916,7 @@ void komodo_args(char *argv0)
|
|||||||
if ( (port= komodo_userpass(ASSETCHAINS_USERPASS,ASSETCHAINS_SYMBOL)) != 0 )
|
if ( (port= komodo_userpass(ASSETCHAINS_USERPASS,ASSETCHAINS_SYMBOL)) != 0 )
|
||||||
ASSETCHAINS_RPCPORT = port;
|
ASSETCHAINS_RPCPORT = port;
|
||||||
else komodo_configfile(ASSETCHAINS_SYMBOL,ASSETCHAINS_P2PPORT + 1);
|
else komodo_configfile(ASSETCHAINS_SYMBOL,ASSETCHAINS_P2PPORT + 1);
|
||||||
if (ASSETCHAINS_LASTERA == 0 && ASSETCHAINS_REWARD[0] == 0)
|
if (ASSETCHAINS_LASTERA == 0)
|
||||||
COINBASE_MATURITY = 1;
|
COINBASE_MATURITY = 1;
|
||||||
//fprintf(stderr,"ASSETCHAINS_RPCPORT (%s) %u\n",ASSETCHAINS_SYMBOL,ASSETCHAINS_RPCPORT);
|
//fprintf(stderr,"ASSETCHAINS_RPCPORT (%s) %u\n",ASSETCHAINS_SYMBOL,ASSETCHAINS_RPCPORT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1335,6 +1335,8 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio
|
|||||||
//fprintf(stderr,"private chain nValue %.8f iscoinbase.%d\n",(double)txout.nValue/COIN,iscoinbase);
|
//fprintf(stderr,"private chain nValue %.8f iscoinbase.%d\n",(double)txout.nValue/COIN,iscoinbase);
|
||||||
if (iscoinbase == 0 && txout.nValue > 0)
|
if (iscoinbase == 0 && txout.nValue > 0)
|
||||||
{
|
{
|
||||||
|
// TODO: if we are upgraded to Sapling, we can allow Sprout sourced funds to sit in a transparent address
|
||||||
|
//
|
||||||
char destaddr[65];
|
char destaddr[65];
|
||||||
Getscriptaddress(destaddr,txout.scriptPubKey);
|
Getscriptaddress(destaddr,txout.scriptPubKey);
|
||||||
if ( komodo_isnotaryvout(destaddr) == 0 )
|
if ( komodo_isnotaryvout(destaddr) == 0 )
|
||||||
|
|||||||
Reference in New Issue
Block a user