BOXFoundation / boxd

Blockchain for BOX Payout
MIT License
40 stars 10 forks source link

boxd hang with error: "Address only applies to p2pkh and token txs" #278

Closed Jerick26 closed 4 years ago

Jerick26 commented 5 years ago

Expected Behavior

run normally

Current Behavior

send tx:

vin {
  prev_out_point {
    hash: "5\350!-\332~C\301\034\254w\237\340\300.QI\267\205nR\347r\026\215=D\237[~\200\375"
  }
  script_sig: "F0D\002 {.\364yf.\217\372\276f\255\345k\237\035Ka\311\235\020\325\277\211\200\204n]\245C\027\363\244\002 B\367\251\373\236\330)0\234 I\021\241\2015\307_\204\227\276\035\004\023\274\014\031\346\222a\356\332R!\003\037^\024\276m\r\0268\371\355Bf2\245\017\025\254/G\343\272S20n\317>N2\310\323\033"
}
vout {
  value: 200
  script_pub_key: "[118, 169, 20, 7, 5, 109, 5, 0, 225, 193, 2, 189, 179, 130, 193, 51, 158, 214, 247, 93, 181, 204, 199, 136, 172]"
}
vout {
  value: 100
  script_pub_key: "[118, 169, 20, 1, 75, 115, 250, 36, 186, 3, 172, 179, 0, 198, 78, 209, 44, 12, 78, 188, 6, 194, 82, 136, 172]"
}
vout {
  value: 300
  script_pub_key: "[118, 169, 20, 105, 191, 139, 162, 233, 70, 45, 131, 10, 2, 26, 71, 72, 171, 200, 194, 175, 170, 201, 2, 136, 172]"
}
vout {
  value: 400
  script_pub_key: "[118, 169, 20, 19, 185, 170, 71, 119, 119, 197, 22, 3, 162, 213, 239, 182, 32, 212, 159, 174, 209, 189, 92, 136, 172]"
}
vout {
  value: 8900
  script_pub_key: "[118, 169, 20, 19, 185, 170, 71, 119, 119, 197, 22, 3, 162, 213, 239, 182, 32, 212, 159, 174, 209, 189, 92, 136, 172]"
}

Possible Solution

add script check

Steps to Reproduce

1. 2. 3. 4.

Context (Environment)

on testnet

Detailed Description

log:

time="2019-05-09T15:44:07+08:00" level=error msg="Failed to accept the block into the main chain. Err: Address only applies to p2pkh and token txs" source="chain/blockchain.go:427" tag=chain
time="2019-05-09T15:44:08+08:00" level=info msg="Prepare to process block. Hash: cda7a6e6d8d302c3a67a0ce85e795f6bca063f7ed9e124c3edaee930e04f9ba3, Height: 5980199" source="chain/blockchain.go:383" tag=chain
time="2019-05-09T15:44:08+08:00" level=debug msg="Relay New Block. Hash: cda7a6e6d8d302c3a67a0ce85e795f6bca063f7ed9e124c3edaee930e04f9ba3 Height: 5980199" source="chain/blockchain.go:545" tag=chain
time="2019-05-09T15:44:08+08:00" level=debug msg="Try to connect block to main chain. Hash: cda7a6e6d8d302c3a67a0ce85e795f6bca063f7ed9e124c3edaee930e04f9ba3, Height: 5980199" source="chain/blockchain.go:613" tag=chain
time="2019-05-09T15:44:08+08:00" level=debug msg="UTXO: apply block with 4 transactions" source="chain/utxoset.go:164" tag=chain
time="2019-05-09T15:44:08+08:00" level=warning msg="Failed to extract address. utxoWrap: &{value:400 script:[91 49 49 56 44 32 49 54 57 44 32 50 48 44 32 49 57 44 32 49 56 53 44 32 49 55 48 44 32 55 49 44 32 49 49 57 44 32 49 49 57 44 32 49 57 55 44 32 50 50 44 32 51 44 32 49 54 50 44 32 50 49 51 44 32 50 51 57 44 32 49 56 50 44 32 51 50 44 32 50 49 50 44 32 49 53 57 44 32 49 55 52 44 32 50 48 57 44 32 49 56 57 44 32 57 50 44 32 49 51 54 44 32 49 55 50 93] height:5980199 flags:4}, sc: OP_11 31382c203136392c2032302c2031392c203138352c203137302c2037312c203131392c203131392c203139372c2032322c 332c203136322c203231332c203233392c203138322c2033322c203231322c20 [Error: Program counter out of script bound], Err: Address only applies to p2pkh and token txs" source="chain/utxoset.go:365" tag=chain

Possible Implementation