mirror of
https://git.wownero.com/wownero/wownero-puddle.git
synced 2024-08-15 01:03:20 +00:00
disallow integrated payout addresses
Batched transfers (`transfer_split`) fail with transfers to multiple integrated addresses so simply disallow them.
This commit is contained in:
parent
943f6a0875
commit
92de56716b
3 changed files with 19 additions and 5 deletions
14
src/pool.c
14
src/pool.c
|
@ -2974,16 +2974,20 @@ miner_on_login(json_object *message, client_t *client)
|
||||||
|
|
||||||
const char *address = json_object_get_string(login);
|
const char *address = json_object_get_string(login);
|
||||||
uint8_t nt = 0;
|
uint8_t nt = 0;
|
||||||
if (parse_address(address, NULL, &nt, NULL))
|
uint64_t pf = 0;
|
||||||
|
if (parse_address(address, &pf, &nt, NULL))
|
||||||
{
|
{
|
||||||
send_validation_error(client,
|
send_validation_error(client, "Invalid address");
|
||||||
"Invalid address");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (nt != nettype)
|
if (nt != nettype)
|
||||||
{
|
{
|
||||||
send_validation_error(client,
|
send_validation_error(client, "Invalid address network type");
|
||||||
"Invalid address network type");
|
return;
|
||||||
|
}
|
||||||
|
if (is_integrated(pf))
|
||||||
|
{
|
||||||
|
send_validation_error(client, "Invalid address type");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,15 @@ int parse_address(const char *input, uint64_t *prefix,
|
||||||
return XMR_NO_ERROR;
|
return XMR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int is_integrated(uint64_t prefix)
|
||||||
|
{
|
||||||
|
if (prefix == CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX ||
|
||||||
|
prefix == testnet::CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX ||
|
||||||
|
prefix == stagenet::CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int get_block_hash(const unsigned char *input, const size_t in_size,
|
int get_block_hash(const unsigned char *input, const size_t in_size,
|
||||||
unsigned char *output)
|
unsigned char *output)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,7 @@ int get_hashing_blob(const unsigned char *input, const size_t in_size,
|
||||||
unsigned char **output, size_t *out_size);
|
unsigned char **output, size_t *out_size);
|
||||||
int parse_address(const char *input, uint64_t *prefix,
|
int parse_address(const char *input, uint64_t *prefix,
|
||||||
uint8_t *nettype, unsigned char *pub_spend);
|
uint8_t *nettype, unsigned char *pub_spend);
|
||||||
|
int is_integrated(uint64_t prefix);
|
||||||
int get_block_hash(const unsigned char *input, const size_t in_size,
|
int get_block_hash(const unsigned char *input, const size_t in_size,
|
||||||
unsigned char *output);
|
unsigned char *output);
|
||||||
void get_hash(const unsigned char *input, const size_t in_size,
|
void get_hash(const unsigned char *input, const size_t in_size,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue